mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-18 15:29:12 +00:00
prevent panic when replaying on closed channel
This commit is contained in:
@@ -111,6 +111,12 @@ func (c *Channel) start() {
|
||||
}
|
||||
|
||||
func replay(s *Subscription, history []interface{}) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
log.Println("recoved from panic", r)
|
||||
}
|
||||
}()
|
||||
|
||||
for _, msg := range history {
|
||||
s.send <- msg
|
||||
}
|
||||
|
Reference in New Issue
Block a user