优化部分并发问题
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user