From ef235b11ca23b015263958e145f1cc8b00768e7a Mon Sep 17 00:00:00 2001 From: dengbiao Date: Tue, 9 Jul 2024 15:15:37 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=B8=80=E4=B8=AA=E5=9C=88=E5=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consume/init.go | 12 ++++++------ consume/one_circles_sign_in_consume.go | 14 ++++++++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/consume/init.go b/consume/init.go index 6530b49..f65fc66 100644 --- a/consume/init.go +++ b/consume/init.go @@ -80,11 +80,11 @@ func initConsumes() { //////////////////////////////////////// oneCircles ///////////////////////////////////////////////////// - //jobs[consumeMd.OneCirclesSignInGreenEnergyFunName] = OneCirclesSignInGreenEnergyConsume - //jobs[consumeMd.OneCirclesStartLevelDividendFunName] = OneCirclesStartLevelDividendConsume - //jobs[consumeMd.OneCirclesActivityCoinAutoExchangeGreenEnergyFunName] = OneCirclesActivityCoinAutoExchangeGreenEnergyConsume - //jobs[consumeMd.OneCirclesActivityCoinAutoExchangeGreenEnergyForTeamFunName] = OneCirclesActivityCoinAutoExchangeGreenEnergyForTeamConsume - //jobs[consumeMd.OneCirclesSettlementPublicGiveActivityCoinFunName] = OneCirclesSettlementPublicGiveActivityCoinConsume + jobs[consumeMd.OneCirclesSignInGreenEnergyFunName] = OneCirclesSignInGreenEnergyConsume + jobs[consumeMd.OneCirclesStartLevelDividendFunName] = OneCirclesStartLevelDividendConsume + jobs[consumeMd.OneCirclesActivityCoinAutoExchangeGreenEnergyFunName] = OneCirclesActivityCoinAutoExchangeGreenEnergyConsume + jobs[consumeMd.OneCirclesActivityCoinAutoExchangeGreenEnergyForTeamFunName] = OneCirclesActivityCoinAutoExchangeGreenEnergyForTeamConsume + jobs[consumeMd.OneCirclesSettlementPublicGiveActivityCoinFunName] = OneCirclesSettlementPublicGiveActivityCoinConsume //jobs[consumeMd.OneCirclesSignInCopyGreenEnergyFunName] = OneCirclesSignInCopyGreenEnergyConsume //////////////////////////////////////// withdraw ///////////////////////////////////////////////////// @@ -100,7 +100,7 @@ func initConsumes() { ////////////////////////////////////// SuperCloudIssuance ///////////////////////////////////////////////////// //jobs[consumeMd.SuperCloudIssuanceMsgCallBackFunName] = SuperCloudIssuanceMsgCallBackConsume - jobs[consumeMd.SuperCloudIssuanceAsyncMLoginFunName] = SuperCloudIssuanceAsyncMLoginConsume + //jobs[consumeMd.SuperCloudIssuanceAsyncMLoginFunName] = SuperCloudIssuanceAsyncMLoginConsume } func Run() { diff --git a/consume/one_circles_sign_in_consume.go b/consume/one_circles_sign_in_consume.go index 83f12ae..ec91721 100644 --- a/consume/one_circles_sign_in_consume.go +++ b/consume/one_circles_sign_in_consume.go @@ -3,6 +3,7 @@ package consume import ( "applet/app/cfg" "applet/app/db" + "applet/app/utils" "applet/app/utils/logx" "applet/consume/md" "code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" @@ -36,11 +37,16 @@ func OneCirclesSignInGreenEnergyConsume(queue md.MqQueue) { if ok == true { err = handleOneCirclesSignInGreenEnergy(res.Body) if err != nil { - fmt.Println("OneCirclesSignInGreenEnergyConsume_ERR:::::", err.Error()) + fmt.Println("err ::: ", err) + utils.FilePutContents("OneCirclesSignInGreenEnergyConsume_ERR", "[err]:"+err.Error()) + _ = res.Reject(false) + //TODO::重新推回队列末尾,避免造成队列堵塞 + var msg *md.OneCirclesStructForSignIn + json.Unmarshal(res.Body, &msg) + ch.Publish(queue.ExchangeName, msg, queue.RoutKey) + } else { + _ = res.Ack(true) } - //_ = res.Reject(false) - err = res.Ack(true) - fmt.Println("err ::: ", err) } else { panic(errors.New("error getting message")) }