Files
timerx/keys.go
T
2026-05-27 14:09:08 +08:00

12 lines
407 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package timerx
import "strings"
// sanitizeKeyPrefix 移除 keyPrefix 中的 {} 字符,避免破坏 Redis Cluster hash tag
// Redis Cluster 使用 first {..} 配对作为 hash tag,keyPrefix 中包含的 {} 会干扰此机制
func sanitizeKeyPrefix(keyPrefix string) string {
keyPrefix = strings.ReplaceAll(keyPrefix, "{", "_")
keyPrefix = strings.ReplaceAll(keyPrefix, "}", "_")
return keyPrefix
}