为asynq历史任务在redis中添加生命周期,过期时间为订单过期时间

This commit is contained in:
dev
2026-01-27 12:18:32 +08:00
parent 14435ba426
commit 9def1ec447
9 changed files with 55 additions and 18 deletions
+4 -1
View File
@@ -5,6 +5,7 @@ import (
"net/http"
"sync"
"github.com/assimon/luuu/config"
"github.com/spf13/viper"
"github.com/assimon/luuu/model/data"
@@ -139,7 +140,9 @@ func Trc20CallBack(token string, wg *sync.WaitGroup) {
// 回调队列
orderCallbackQueue, _ := handle.NewOrderCallbackQueue(order)
orderNoticeMaxRetry := viper.GetInt("order_notice_max_retry")
mq.MClient.Enqueue(orderCallbackQueue, asynq.MaxRetry(orderNoticeMaxRetry))
mq.MClient.Enqueue(orderCallbackQueue, asynq.MaxRetry(orderNoticeMaxRetry),
asynq.Retention(config.GetOrderExpirationTimeDuration()),
)
// mq.MClient.Enqueue(orderCallbackQueue, asynq.MaxRetry(5))
// 发送机器人消息
msgTpl := `