fix: set default worker parameter (#22960)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2025-07-28 14:12:39 +08:00
committed by GitHub
parent 7d453caff6
commit 061988edea
+6
View File
@@ -188,6 +188,12 @@ func NewWorkerManager(name string, workerCount int, backlog int, dbWorker bool)
}
func NewWorkerManagerIgnoreOverflow(name string, workerCount int, backlog int, dbWorker bool, ignoreOverflow bool) *SWorkerManager {
if workerCount <= 0 {
workerCount = 1
}
if backlog <= 0 {
backlog = 128
}
manager := SWorkerManager{name: name,
queue: NewRing(workerCount * backlog),
workerCount: workerCount,