From 7ea1556b7af137fdff0937d45f0a3dc1ad43300d Mon Sep 17 00:00:00 2001 From: iamhujiebin <458249864@qq.com> Date: Wed, 9 Aug 2023 00:19:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=B0=83=E6=95=B4=E9=80=9F=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 6d4eada..d8cb459 100644 --- a/main.go +++ b/main.go @@ -22,8 +22,8 @@ import ( "time" ) -const SEND_WORKER = 2000 // 消费端协程数量 -const MONITOR_LENGTH = 100 // 队列告警数量 +const SEND_WORKER = 1 // 消费端协程数量 +const MONITOR_LENGTH = 1000 // 队列告警数量 const SocketQueueSendGift = "socket:queue:send_gift" var userClient userCenter.UserClient @@ -92,7 +92,7 @@ func main() { mylogrus.MyLog.Infof("cron sendGiftChan start") // 8核 n send + 4 blpop sendGiftChan = make(chan *SendGiftMsg, SEND_WORKER) - for i := 0; i < 4; i++ { + for i := 0; i < 1; i++ { go func() { deal() }() @@ -107,7 +107,7 @@ func main() { } func check() { - tick := time.NewTicker(time.Second * 3) + tick := time.NewTicker(time.Second * 30) defer tick.Stop() for { select { @@ -148,7 +148,7 @@ func deal() { } sendGiftChan <- msg } - time.Sleep(time.Second) // 控制全服banner速率 + time.Sleep(time.Second * 5) // 控制全服banner速率 } } -- 2.22.0