diff --git a/src/.env.example b/src/.env.example index c315397..99ad350 100644 --- a/src/.env.example +++ b/src/.env.example @@ -70,6 +70,7 @@ api_auth_token= #订单过期时间(单位分钟) order_expiration_time=10 - +#订单回调失败最大重试次数 +order_notice_max_retry=0 #强制汇率(设置此参数后每笔交易将按照此汇率计算,例如:6.4) forced_usdt_rate= \ No newline at end of file diff --git a/src/model/service/task_service.go b/src/model/service/task_service.go index 086dba3..67b0c82 100644 --- a/src/model/service/task_service.go +++ b/src/model/service/task_service.go @@ -2,6 +2,9 @@ package service import ( "fmt" + "net/http" + "sync" + "github.com/assimon/luuu/model/data" "github.com/assimon/luuu/model/request" "github.com/assimon/luuu/mq" @@ -14,8 +17,6 @@ import ( "github.com/gookit/goutil/stdutil" "github.com/hibiken/asynq" "github.com/shopspring/decimal" - "net/http" - "sync" ) const UsdtTrc20ApiUri = "https://apilist.tronscanapi.com/api/transfer/trc20" @@ -135,7 +136,10 @@ func Trc20CallBack(token string, wg *sync.WaitGroup) { } // 回调队列 orderCallbackQueue, _ := handle.NewOrderCallbackQueue(order) - mq.MClient.Enqueue(orderCallbackQueue, asynq.MaxRetry(5)) + orderCallbackQueue, _ := handle.NewOrderCallbackQueue(order) + orderNoticeMaxRetry := viper.GetInt("order_notice_max_retry") + mq.MClient.Enqueue(orderCallbackQueue, asynq.MaxRetry(orderNoticeMaxRetry)) + // mq.MClient.Enqueue(orderCallbackQueue, asynq.MaxRetry(5)) // 发送机器人消息 msgTpl := ` 📢📢有新的交易支付成功!