refactor(common): 重构缓存管理模块,将cache迁移至share包并实现泛型缓存存储

This commit is contained in:
575560454
2025-07-15 18:10:25 +00:00
parent 38ec291275
commit b647c74808
6 changed files with 43 additions and 42 deletions

View File

@@ -6,8 +6,8 @@ import (
"sync/atomic"
"time"
"blazing/common/data/cache"
"blazing/common/data/entity"
"blazing/common/data/share"
"github.com/gogf/gf/v2/os/glog"
"github.com/panjf2000/gnet/v2"
@@ -49,7 +49,8 @@ func (s *Server) OnClose(c gnet.Conn, _ error) (action gnet.Action) {
t := v.GetPlayer()
if t != nil {
glog.Debug(context.Background(), t.UserID, "断开连接")
cache.NewSessionManager().DeleteUserOnline(t.UserID) //设置用户登录服务器
share.ShareManager.DeleteUserOnline(t.UserID) //设置用户登录服务器
}
//}