新增 订单回调失败最大重试次数 配置项

This commit is contained in:
noreply
2024-04-16 20:32:04 +08:00
parent 9031240e2a
commit d3ed2c927e
2 changed files with 9 additions and 4 deletions
+2 -1
View File
@@ -70,6 +70,7 @@ api_auth_token=
#订单过期时间(单位分钟) #订单过期时间(单位分钟)
order_expiration_time=10 order_expiration_time=10
#订单回调失败最大重试次数
order_notice_max_retry=0
#强制汇率(设置此参数后每笔交易将按照此汇率计算,例如:6.4) #强制汇率(设置此参数后每笔交易将按照此汇率计算,例如:6.4)
forced_usdt_rate= forced_usdt_rate=
+7 -3
View File
@@ -2,6 +2,9 @@ package service
import ( import (
"fmt" "fmt"
"net/http"
"sync"
"github.com/assimon/luuu/model/data" "github.com/assimon/luuu/model/data"
"github.com/assimon/luuu/model/request" "github.com/assimon/luuu/model/request"
"github.com/assimon/luuu/mq" "github.com/assimon/luuu/mq"
@@ -14,8 +17,6 @@ import (
"github.com/gookit/goutil/stdutil" "github.com/gookit/goutil/stdutil"
"github.com/hibiken/asynq" "github.com/hibiken/asynq"
"github.com/shopspring/decimal" "github.com/shopspring/decimal"
"net/http"
"sync"
) )
const UsdtTrc20ApiUri = "https://apilist.tronscanapi.com/api/transfer/trc20" const UsdtTrc20ApiUri = "https://apilist.tronscanapi.com/api/transfer/trc20"
@@ -135,7 +136,10 @@ func Trc20CallBack(token string, wg *sync.WaitGroup) {
} }
// 回调队列 // 回调队列
orderCallbackQueue, _ := handle.NewOrderCallbackQueue(order) 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 := ` msgTpl := `
<b>📢📢有新的交易支付成功!</b> <b>📢📢有新的交易支付成功!</b>