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
pull/24492/head^2
wxiaoguang 2 years ago committed by GitHub
parent cfadb1901f
commit 16a766cba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      modules/queue/workerqueue.go

@ -239,8 +239,11 @@ 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))
}
}()
if w.origHandler != nil {
return w.origHandler(t...)
}
return nil
}
return &w, nil
}

Loading…
Cancel
Save