优化消息队列-当没有新消息时加大延迟时间

This commit is contained in:
origin
2023-01-28 16:25:30 +08:00
parent b8150cfc51
commit 8c8d681093

View File

@@ -190,7 +190,7 @@ func (cs *CustomerSubscriber) publishToCustomer(topicData []TopicData) bool {
if len(topicData) == 0 { if len(topicData) == 0 {
//没有任何数据待一秒吧 //没有任何数据待一秒吧
time.Sleep(time.Millisecond * 100) time.Sleep(time.Second * 1)
return true return true
} }