From ca1a8c55d68f15d910f21d568339e6555e4b7e54 Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Sun, 31 May 2020 13:43:42 -0700 Subject: Remove redis namespace collision prevention When cogs reload, it would consider their namespace as a conflict with the original namespace. This feature will be removed as a fix until we come up with a better solution. --- bot/utils/redis_cache.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/bot/utils/redis_cache.py b/bot/utils/redis_cache.py index de80cee84..354e987b9 100644 --- a/bot/utils/redis_cache.py +++ b/bot/utils/redis_cache.py @@ -100,16 +100,7 @@ class RedisCache: def _set_namespace(self, namespace: str) -> None: """Try to set the namespace, but do not permit collisions.""" - # We need a unique namespace, to prevent collisions. This loop - # will try appending underscores to the end of the namespace until - # it finds one that is unique. - # - # For example, if `john` and `john_` are both taken, the namespace will - # be `john__` at the end of this loop. - while namespace in self._namespaces: - namespace += "_" - - log.trace(f"RedisCache setting namespace to {self._namespace}") + log.trace(f"RedisCache setting namespace to {namespace}") self._namespaces.append(namespace) self._namespace = namespace -- cgit v1.2.3