Skip to content

Commit f4ff5f4

Browse files
committed
Avoid caching the config settings.
This causes problems with tests and changing the settings via override_settings. Since we're using the lru_cache decorator on get_config, there's very little benefit to caching within the store too.
1 parent 3e4c484 commit f4ff5f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

debug_toolbar/store.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ def deserialize(data: str) -> Any:
3434

3535

3636
class BaseStore:
37-
_config = dt_settings.get_config().copy()
38-
3937
@classmethod
4038
def request_ids(cls) -> Iterable:
4139
"""The stored request ids"""
@@ -94,7 +92,9 @@ def set(cls, request_id: str):
9492
"""Set a request_id in the request store"""
9593
if request_id not in cls._request_ids:
9694
cls._request_ids.append(request_id)
97-
for _ in range(len(cls._request_ids) - cls._config["RESULTS_CACHE_SIZE"]):
95+
for _ in range(
96+
len(cls._request_ids) - dt_settings.get_config()["RESULTS_CACHE_SIZE"]
97+
):
9898
removed_id = cls._request_ids.popleft()
9999
cls._request_store.pop(removed_id, None)
100100

0 commit comments

Comments
 (0)