Browse Source

update

master
shenjiachi 14 hours ago
parent
commit
c64488a4c1
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      consume/egg_fin_withdraw_apply_consume.go

+ 7
- 2
consume/egg_fin_withdraw_apply_consume.go View File

@@ -55,7 +55,7 @@ func EggFinWithdrawApplyDataConsume(queue md.MqQueue) {
for {
res, ok = <-delivery
if ok == true {
err = handleEggFinWithdrawApplyDataConsume(res.Body, client)
err = handleEggFinWithdrawApplyDataConsume(res.Body, client, ch)
if err != nil {
fmt.Println("EggFinWithdrawApplyDataConsume:::::", err.Error())
utils2.FilePutContents("EggFinWithdrawApplyDataConsume", utils2.SerializeStr(map[string]interface{}{
@@ -89,7 +89,7 @@ func EggFinWithdrawApplyDataConsume(queue md.MqQueue) {
}
}

func handleEggFinWithdrawApplyDataConsume(msgData []byte, client *alipay.Client) error {
func handleEggFinWithdrawApplyDataConsume(msgData []byte, client *alipay.Client, ch *rabbit.Channel) error {
time.Sleep(time.Duration(100) * time.Millisecond) //休眠100毫秒
// 1.解析mq中queue的数据结构体
var msg *md2.EggFinWithdrawApplyData
@@ -148,6 +148,11 @@ func handleEggFinWithdrawApplyDataConsume(msgData []byte, client *alipay.Client)
})
_, err = client.FundTransUniTransfer(context.Background(), bm)
if err != nil {
// 如果需要重试 推回队尾
if err.Error() == "Lock wait timeout exceeded; try restarting transaction" {
ch.Publish(md2.EggAppExchange, msg, md2.EggFinWithdrawApply)
return nil
}
//TODO::处理提现失败
err = dealFinWithdrawApplyStateForBad(apply)
if err != nil {


Loading…
Cancel
Save