mirror of
https://github.com/christianselig/apollo-backend
synced 2024-12-25 15:55:28 +00:00
control pool size
This commit is contained in:
parent
2b81f4c59f
commit
2ea133966b
1 changed files with 6 additions and 0 deletions
|
@ -58,8 +58,14 @@ func WorkerCmd(ctx context.Context) *cobra.Command {
|
|||
}
|
||||
defer redis.Close()
|
||||
|
||||
fp, err := cmdutil.NewFaktoryPool(poolSize + 2)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mgr := faktoryworker.NewManager()
|
||||
mgr.Concurrency = consumers
|
||||
mgr.Pool = fp
|
||||
for queue, workerFn := range queues {
|
||||
worker := workerFn(ctx, logger, statsd, db, redis, consumers)
|
||||
mgr.Register(queue, worker.Process)
|
||||
|
|
Loading…
Reference in a new issue