diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-05-23 19:40:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-23 13:40:55 +0200 |
commit | 16a766cba10dcaf53cc413cee62a952031bef5bc (patch) | |
tree | e312e103372ec043d9e3e4e35f8c7185847def3a /modules/queue | |
parent | cfadb1901f7b6910a8d451538c960c4a8138cdc8 (diff) | |
download | gitea-16a766cba10dcaf53cc413cee62a952031bef5bc.tar.gz gitea-16a766cba10dcaf53cc413cee62a952031bef5bc.zip |
Do not call nil handler for a dummy queue (#24880)
A dummy queue doesn't really have a handler (see line 211), so the
`safeHandler` can safely drop all items
Diffstat (limited to 'modules/queue')
-rw-r--r-- | modules/queue/workerqueue.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/queue/workerqueue.go b/modules/queue/workerqueue.go index de4485fa51..5695c6cc23 100644 --- a/modules/queue/workerqueue.go +++ b/modules/queue/workerqueue.go @@ -239,7 +239,10 @@ func NewWorkerPoolQueueBySetting[T any](name string, queueSetting setting.QueueS log.Error("Recovered from panic in queue %q handler: %v\n%s", name, err, log.Stack(2)) } }() - return w.origHandler(t...) + if w.origHandler != nil { + return w.origHandler(t...) + } + return nil } return &w, nil |