mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-26 21:44:44 +00:00
Merge pull request #2526 from nsheridan/panic_recover
Recover panic on closed channel
This commit is contained in:
commit
166faba684
1 changed files with 3 additions and 0 deletions
|
@ -79,6 +79,9 @@ func EventStreamSSE(c *gin.Context) {
|
||||||
go func() {
|
go func() {
|
||||||
// TODO remove this from global config
|
// TODO remove this from global config
|
||||||
Config.Services.Pubsub.Subscribe(ctx, "topic/events", func(m pubsub.Message) {
|
Config.Services.Pubsub.Subscribe(ctx, "topic/events", func(m pubsub.Message) {
|
||||||
|
defer func() {
|
||||||
|
recover() // fix #2480
|
||||||
|
}()
|
||||||
name := m.Labels["repo"]
|
name := m.Labels["repo"]
|
||||||
priv := m.Labels["private"]
|
priv := m.Labels["private"]
|
||||||
if repo[name] || priv == "false" {
|
if repo[name] || priv == "false" {
|
||||||
|
|
Loading…
Reference in a new issue