Skip to content

Commit

Permalink
Warn if initialization arguments are discarded by multi_cached becaus…
Browse files Browse the repository at this point in the history
…e alias takes precedence
  • Loading branch information
padraic-shafer committed Jan 10, 2023
1 parent 8f33f9e commit 7615cfb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aiocache/decorators.py
Expand Up @@ -309,6 +309,9 @@ def __init__(
def __call__(self, f):
if self.alias:
self.cache = caches.get(self.alias)
for arg in ("serializer", "namespace", "plugins"):
if getattr(self, f'_{arg}', None) is not None:
logger.warning(f"Using cache alias; ignoring '{arg}' argument.")
else:
self.cache = _get_cache(
cache=self._cache,
Expand Down

0 comments on commit 7615cfb

Please sign in to comment.