diff --git a/cloud_issuance/db/db_cloud_issuance_user_robot_bind_follow.go b/cloud_issuance/db/db_cloud_issuance_user_robot_bind_follow.go index 40ca75f..31a4333 100644 --- a/cloud_issuance/db/db_cloud_issuance_user_robot_bind_follow.go +++ b/cloud_issuance/db/db_cloud_issuance_user_robot_bind_follow.go @@ -49,7 +49,6 @@ func (cloudIssuanceUserRobotBindFollowDb *CloudIssuanceUserRobotBindFollowDb) Ge } func (cloudIssuanceUserRobotBindFollowDb *CloudIssuanceUserRobotBindFollowDb) GetCloudIssuanceUserRobotBindFollowByChatRoomId(chatRoomId string, robotId int) (m *model.CloudIssuanceUserRobotBindFollow, err error) { - time.Sleep(time.Millisecond * 50) // 等待50毫秒 m = new(model.CloudIssuanceUserRobotBindFollow) has, err := cloudIssuanceUserRobotBindFollowDb.Db.Where("chat_room_id =? AND robot_id = ? AND state = 1", chatRoomId, robotId).Get(m) if err != nil { diff --git a/cloud_issuance/svc/svc_deal_call_back.go b/cloud_issuance/svc/svc_deal_call_back.go index 0447d46..2b3ecd1 100644 --- a/cloud_issuance/svc/svc_deal_call_back.go +++ b/cloud_issuance/svc/svc_deal_call_back.go @@ -61,7 +61,8 @@ func (dealCloudIssuanceCallBackService *DealCloudIssuanceCallBackService) DealCa "content": req.Data.Content, } utils.FilePutContents("cloud", utils.SerializeStr(args)) - time.Sleep(time.Millisecond * 200) // 等待200毫秒 + randInt := utils.RandIntRand(10, 100) + time.Sleep(time.Millisecond * time.Duration(randInt)) // 等待10 ~ 100毫秒 chain := chain_transfer.TurnChain(svc.MasterDb(c), db2.Db, args) utils.FilePutContents("cloud_resp", utils.SerializeStr(chain)) if chain.Count != "" { diff --git a/consume/cloud_issuance_msg_callback.go b/consume/cloud_issuance_msg_callback.go index c801f46..47a9d12 100644 --- a/consume/cloud_issuance_msg_callback.go +++ b/consume/cloud_issuance_msg_callback.go @@ -40,7 +40,8 @@ func CloudIssuanceMsgCallBackConsume(queue md.MqQueue) { if err != nil { panic(err) } - time.Sleep(time.Millisecond * 300) // 等待300毫秒 + randInt := utils.RandIntRand(100, 200) + time.Sleep(time.Millisecond * time.Duration(randInt)) // 等待100 ~ 200毫秒 go func() { //设置masterId cloudIssuanceRobotRecords, err := db.CloudIssuanceRobotRecordsGetOneByParams(map[string]interface{}{