From d3ed2c927e123dbfcd0fc899e5faaca5adf4e091 Mon Sep 17 00:00:00 2001 From: noreply Date: Tue, 16 Apr 2024 20:32:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=E5=A4=B1=E8=B4=A5=E6=9C=80=E5=A4=A7=E9=87=8D?= =?UTF-8?q?=E8=AF=95=E6=AC=A1=E6=95=B0=20=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/.env.example | 3 ++- src/model/service/task_service.go | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) 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 := ` 📢📢有新的交易支付成功!