From 7b77926b4b01edc340f8f0c61d878a3f866e8d36 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 25 May 2024 11:47:07 +0800 Subject: [PATCH] 1 --- server/statserver/session/sessionmgr.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/statserver/session/sessionmgr.go b/server/statserver/session/sessionmgr.go index 5d463e40..7c80367d 100644 --- a/server/statserver/session/sessionmgr.go +++ b/server/statserver/session/sessionmgr.go @@ -3,6 +3,7 @@ package session import ( "q5" "f5" + "time" "sync" ) @@ -27,6 +28,7 @@ func (this *sessionMgr) Init() { this, 60, 10000) + go this.updateTimer() } func (this *sessionMgr) UnInit() { @@ -61,3 +63,12 @@ func (this *sessionMgr) getSession(accountId string) *userSession { return nil } } + +func (this *sessionMgr) updateTimer() { + for true { + this.lock.Lock() + this.timer.Update() + this.lock.Unlock() + time.Sleep(1 * time.Second); + } +}