修复(#1): 服务器用户列表缓存按 protocol 隔离 + 兜底不写缓存
服务器用户列表缓存跨协议污染修复(HIF-1 / 详见 PR #5 四件套): 1. 缓存 key 加 protocol 维度(`server:user:{server_id}:{protocol}`),对齐 ServerConfig 已有约定 2. 显式枚举协议清除用户列表缓存(AllProtocols + ServerUserListCacheKeysForServer),不用 SCAN 3. 三个兜底分支不写缓存 + Errorw 日志(带 server_id + protocol 字段) 4. hysteria2 → hysteria 兼容归一化 + 6 个新单测 Closes HIF-1
This commit is contained in:
@@ -71,7 +71,7 @@ func (m *defaultSubscribeModel) getCacheKeys(data *Subscribe) []string {
|
||||
})
|
||||
if err == nil {
|
||||
for _, n := range nodes {
|
||||
keys = append(keys, fmt.Sprintf("%s%d", node.ServerUserListCacheKey, n.ServerId))
|
||||
keys = append(keys, node.ServerUserListCacheKeysForServer(n.ServerId)...)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ func (m *defaultSubscribeModel) getCacheKeys(data *Subscribe) []string {
|
||||
})
|
||||
if err == nil {
|
||||
for _, n := range nodes {
|
||||
keys = append(keys, fmt.Sprintf("%s%d", node.ServerUserListCacheKey, n.ServerId))
|
||||
keys = append(keys, node.ServerUserListCacheKeysForServer(n.ServerId)...)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user