Skip to content

Commit d0b72da

Browse files
swordqiuQiu Jian
andauthored
fix: set default worker parameter (#22957)
Co-authored-by: Qiu Jian <[email protected]>
1 parent 9d8d9b8 commit d0b72da

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/appsrv/workers.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ func NewWorkerManager(name string, workerCount int, backlog int, dbWorker bool)
191191
}
192192

193193
func NewWorkerManagerIgnoreOverflow(name string, workerCount int, backlog int, dbWorker bool, ignoreOverflow bool) *SWorkerManager {
194+
if workerCount <= 0 {
195+
workerCount = 1
196+
}
197+
if backlog <= 0 {
198+
backlog = 128
199+
}
194200
manager := SWorkerManager{name: name,
195201
queue: NewRing(workerCount * backlog),
196202
workerCount: workerCount,

0 commit comments

Comments
 (0)