2
0
mirror of https://github.com/hibiken/asynq.git synced 2026-05-24 03:12:16 +08:00

[performance] Skip the overhead of json decoding when scheduling to one

queue
This commit is contained in:
Ken Hibino
2020-01-14 07:26:41 -08:00
parent 5a6f737589
commit cb2ebf18ac
5 changed files with 50 additions and 11 deletions

View File

@@ -108,9 +108,11 @@ func NewBackground(r *redis.Client, cfg *Config) *Background {
if queues == nil || len(queues) == 0 {
queues = defaultQueueConfig
}
qcfg := normalizeQueueCfg(queues)
rdb := rdb.NewRDB(r)
scheduler := newScheduler(rdb, 5*time.Second)
processor := newProcessor(rdb, n, normalizeQueueCfg(queues), cfg.StrictPriority, delayFunc)
scheduler := newScheduler(rdb, 5*time.Second, qcfg)
processor := newProcessor(rdb, n, qcfg, cfg.StrictPriority, delayFunc)
return &Background{
rdb: rdb,
scheduler: scheduler,