online cache

This commit is contained in:
withchao 2024-07-02 15:52:57 +08:00
parent 6e2659c64a
commit f87ee44459

View File

@ -100,7 +100,7 @@ func (ws *WsServer) ChangeOnlineStatus(concurrent int) {
case now := <-scanTicker.C: case now := <-scanTicker.C:
pushUserState(ws.clients.GetAllUserStatus(now.Add(-cachekey.OnlineExpire/3), now)...) pushUserState(ws.clients.GetAllUserStatus(now.Add(-cachekey.OnlineExpire/3), now)...)
case state := <-ws.clients.UserState(): case state := <-ws.clients.UserState():
log.ZDebug(context.Background(), "user online change", "userID", state.UserID, "online", state.Online, "offline", state.Offline) log.ZDebug(context.Background(), "OnlineCache user online change", "userID", state.UserID, "online", state.Online, "offline", state.Offline)
pushUserState(state) pushUserState(state)
} }
} }