mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-06-02 21:49:25 +00:00
Recover panic on closed channel
Related to #2480 Signed-off-by: Niall Sheridan <nsheridan@squarespace.com>
This commit is contained in:
parent
bc22e226d0
commit
a55fa44589
|
@ -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