mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-14 16:07:42 +00:00
make pool sizes customized
This commit is contained in:
parent
447a21ba60
commit
e241f67888
1 changed files with 3 additions and 5 deletions
|
@ -52,21 +52,19 @@ func WorkerCmd(ctx context.Context) *cobra.Command {
|
||||||
|
|
||||||
tracer := otel.Tracer(tag)
|
tracer := otel.Tracer(tag)
|
||||||
|
|
||||||
poolSize := consumers / 8
|
db, err := cmdutil.NewDatabasePool(ctx, consumers/16)
|
||||||
|
|
||||||
db, err := cmdutil.NewDatabasePool(ctx, poolSize)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer db.Close()
|
defer db.Close()
|
||||||
|
|
||||||
redis, err := cmdutil.NewRedisLocksClient(ctx, poolSize)
|
redis, err := cmdutil.NewRedisLocksClient(ctx, consumers/8)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer redis.Close()
|
defer redis.Close()
|
||||||
|
|
||||||
qredis, err := cmdutil.NewRedisQueueClient(ctx, poolSize)
|
qredis, err := cmdutil.NewRedisQueueClient(ctx, consumers/16)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue