mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 18:26:16 +00:00
为asynq历史任务在redis中添加生命周期,过期时间为订单过期时间
This commit is contained in:
@@ -3,6 +3,7 @@ package handle
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/assimon/luuu/config"
|
||||
"github.com/assimon/luuu/model/data"
|
||||
"github.com/assimon/luuu/model/mdb"
|
||||
@@ -21,7 +22,9 @@ func NewOrderCallbackQueue(order *mdb.Orders) (*asynq.Task, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return asynq.NewTask(QueueOrderCallback, payload), nil
|
||||
return asynq.NewTask(QueueOrderCallback, payload,
|
||||
asynq.Retention(config.GetOrderExpirationTimeDuration()),
|
||||
), nil
|
||||
}
|
||||
|
||||
func OrderCallbackHandle(ctx context.Context, t *asynq.Task) error {
|
||||
|
||||
Reference in New Issue
Block a user