fix
This commit is contained in:
parent
21f06c6e39
commit
8434bd1d95
|
@ -94,12 +94,10 @@ func ConsumeWebsocketStatData(ctx context.Context) {
|
||||||
case TYPE_CONNECT_COUNT: //ws连接计数
|
case TYPE_CONNECT_COUNT: //ws连接计数
|
||||||
statData, ok := mapUserWsStat.Load(key)
|
statData, ok := mapUserWsStat.Load(key)
|
||||||
if !ok {
|
if !ok {
|
||||||
if data.Value <= 0 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
mapUserWsStat.Store(key, mapUserWsStatItem{
|
mapUserWsStat.Store(key, mapUserWsStatItem{
|
||||||
CurWsConnectCount: data.Value,
|
CurWsConnectCount: data.Value,
|
||||||
})
|
})
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
stat, ok := statData.(mapUserWsStatItem)
|
stat, ok := statData.(mapUserWsStatItem)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -107,23 +105,13 @@ func ConsumeWebsocketStatData(ctx context.Context) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
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)
|
||||||
}
|
|
||||||
case TYPE_COMBINE_IMAGE_REQUEST_COUNT: //请求算法合图计数
|
case TYPE_COMBINE_IMAGE_REQUEST_COUNT: //请求算法合图计数
|
||||||
statData, ok := mapUserWsStat.Load(key)
|
statData, ok := mapUserWsStat.Load(key)
|
||||||
//不存在
|
//不存在
|
||||||
if !ok {
|
if !ok {
|
||||||
//数据是减少的
|
|
||||||
if data.Value <= 0 {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
mapUserWsStat.Store(key, mapUserWsStatItem{
|
|
||||||
CurCombineCount: data.Value,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//存在
|
//存在
|
||||||
if stat, ok := statData.(mapUserWsStatItem); ok {
|
if stat, ok := statData.(mapUserWsStatItem); ok {
|
||||||
stat.CurCombineCount += data.Value
|
stat.CurCombineCount += data.Value
|
||||||
|
|
Loading…
Reference in New Issue
Block a user