fix
This commit is contained in:
parent
485319d4f8
commit
8c026be22d
|
@ -96,7 +96,11 @@ func ConsumeWebsocketStatData(ctx context.Context) {
|
||||||
if ok { //存在就累加
|
if ok { //存在就累加
|
||||||
if stat, ok := statData.(mapUserWsStatItem); ok {
|
if stat, ok := statData.(mapUserWsStatItem); ok {
|
||||||
stat.CurWsConnectCount += data.Value
|
stat.CurWsConnectCount += data.Value
|
||||||
|
if stat.CurWsConnectCount == 0 { //为0则移除
|
||||||
|
mapUserWsStat.Delete(key)
|
||||||
|
} else {
|
||||||
mapUserWsStat.Store(key, stat)
|
mapUserWsStat.Store(key, stat)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
logx.Error("断言mapUserWsStatItem错误")
|
logx.Error("断言mapUserWsStatItem错误")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user