1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-12 08:23:48 +02:00

Merge pull request #686 from bradrydzewski/master

prevent panic when replaying on closed channel
This commit is contained in:
Brad Rydzewski 2014-11-10 21:19:38 -08:00
commit cabfb92088

View File

@ -111,6 +111,12 @@ func (c *Channel) start() {
} }
func replay(s *Subscription, history []interface{}) { func replay(s *Subscription, history []interface{}) {
defer func() {
if r := recover(); r != nil {
log.Println("recoved from panic", r)
}
}()
for _, msg := range history { for _, msg := range history {
s.send <- msg s.send <- msg
} }