aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2020-05-26 18:52:52 +0200
committerGravatar Leon Sandøy <[email protected]>2020-05-26 19:07:14 +0200
commit19206734df651c7d65e5114715db6db9253cb7d6 (patch)
tree187b7e36a6d3cc42fb10684b387de2309ca7ec7e
parentAdd better docstring for RedisCache.update (diff)
Make self.increment_lock private.
-rw-r--r--bot/utils/redis_cache.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/utils/redis_cache.py b/bot/utils/redis_cache.py
index b77ec47a2..89af225e2 100644
--- a/bot/utils/redis_cache.py
+++ b/bot/utils/redis_cache.py
@@ -81,7 +81,7 @@ class RedisCache:
"""Initialize the RedisCache."""
self._namespace = None
self.bot = None
- self.increment_lock = asyncio.Lock()
+ self._increment_lock = asyncio.Lock()
def _set_namespace(self, namespace: str) -> None:
"""Try to set the namespace, but do not permit collisions."""
@@ -348,7 +348,7 @@ class RedisCache:
log.trace(f"Attempting to increment/decrement the value with the key {key} by {amount}.")
# Since this has several API calls, we need a lock to prevent race conditions
- async with self.increment_lock:
+ async with self._increment_lock:
value = await self.get(key)
# Can't increment a non-existing value