优化性能监控与rankservice持久化

This commit is contained in:
duanhf2012
2023-05-09 14:06:17 +08:00
parent 92fdb7860c
commit b392617d6e
4 changed files with 20 additions and 17 deletions

View File

@@ -71,6 +71,7 @@ func (mp *MongoPersist) OnInit() error {
}
//开启协程
mp.waitGroup.Add(1)
go mp.persistCoroutine()
return nil
@@ -261,7 +262,6 @@ func (mp *MongoPersist) JugeTimeoutSave() bool{
}
func (mp *MongoPersist) persistCoroutine(){
mp.waitGroup.Add(1)
defer mp.waitGroup.Done()
for atomic.LoadInt32(&mp.stop)==0 || mp.hasPersistData(){
//间隔时间sleep