From 185ee074e97739169fe2e07ca2f260f52b98703c Mon Sep 17 00:00:00 2001 From: Alex Rothberg Date: Wed, 15 Mar 2023 23:14:44 -0400 Subject: [PATCH] Clear cache if it exists upon setting alias --- aiocache/factory.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aiocache/factory.py b/aiocache/factory.py index e1ebac33..9517ee5c 100644 --- a/aiocache/factory.py +++ b/aiocache/factory.py @@ -151,6 +151,7 @@ def add(self, alias: str, config: Dict[str, object]) -> None: :param config: Mapping containing the cache configuration """ self._config[alias] = config + self._caches.pop(alias, None) def get(self, alias: str) -> object: """