From ae421219cbe8860dc6ec0566e7bb27a0df4cdc1c Mon Sep 17 00:00:00 2001 From: Sinh Date: Mon, 8 Jul 2024 15:47:03 +0700 Subject: [PATCH] feat: update queue config - support prefix to prevent conflict --- task.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/task.go b/task.go index 541820c..968207d 100644 --- a/task.go +++ b/task.go @@ -1,8 +1,9 @@ package queue import ( - "github.com/hibiken/asynq" "time" + + "github.com/hibiken/asynq" ) const ( @@ -19,6 +20,7 @@ func (i Instance) RunTask(typename string, payload []byte, priority string, retr if priority != PriorityCritical && priority != PriorityDefault && priority != PriorityLow { priority = PriorityDefault } + priority = i.Config.QueuePrefix + priority options = append(options, asynq.Queue(priority)) // Retry times