diff options
| author | 2020-05-17 10:58:54 +0300 | |
|---|---|---|
| committer | 2020-05-17 10:58:54 +0300 | |
| commit | d3072a23d460524e9bb64b8724afbd0b2c44e305 (patch) | |
| tree | 359fe27d52cbbfe4134f45bc88d1035ca062e2ee | |
| parent | PEP Improvisations: Move error embed to variables instead creating on `ctx.send` (diff) | |
PEP Improvisations: Fix cache if statement
Add `not` in check is key exist in cache.
| -rw-r--r-- | bot/utils/cache.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/utils/cache.py b/bot/utils/cache.py index 1c0935faa..96e1aef95 100644 --- a/bot/utils/cache.py +++ b/bot/utils/cache.py @@ -21,7 +21,7 @@ def async_cache(max_size: int = 128, arg_offset: int = 0) -> Callable: """Decorator wrapper for the caching logic.""" key = ':'.join(str(args[arg_offset:])) - if key in async_cache.cache: + if key not in async_cache.cache: if len(async_cache.cache) > max_size: async_cache.cache.popitem(last=False) |