Skip to content

Commit d0d190a

Browse files
Update reflex/utils/redis_keys.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 6a64fb6 commit d0d190a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

reflex/utils/redis_keys.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def logical_redis_key(redis_key: str) -> str:
4242
Returns:
4343
The logical key without any Redis Cluster hash tag prefix.
4444
"""
45-
if redis_key.startswith("{") and "}:" in redis_key:
46-
return redis_key.split("}:", 1)[1]
45+
if redis_key.startswith("{") and "}" in redis_key:
46+
close = redis_key.index("}")
47+
if close + 1 < len(redis_key) and redis_key[close + 1] == ":":
48+
return redis_key[close + 2:]
4749
return redis_key

0 commit comments

Comments
 (0)