mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2026-03-24 14:06:31 +01:00
fix: initialize _lazy_ts before stamping in _rebuild_cache when lazy refresh not started
This commit is contained in:
parent
ac5772b064
commit
e4613ecd80
1 changed files with 5 additions and 1 deletions
|
|
@ -467,7 +467,11 @@ class PriceService(BaseService):
|
|||
with self._lock:
|
||||
self._cache = new_cache
|
||||
self._last_refresh = built_at
|
||||
# Stamp all keys as fresh so get_stale_cards() reflects the rebuild
|
||||
# Stamp all keys as fresh so get_stale_cards() reflects the rebuild.
|
||||
# _lazy_ts may not exist if start_lazy_refresh() was never called
|
||||
# (e.g. when invoked from setup/CI without the full web app).
|
||||
if not hasattr(self, "_lazy_ts"):
|
||||
self._lazy_ts = self._load_lazy_ts()
|
||||
for key in new_cache:
|
||||
self._lazy_ts[key] = built_at
|
||||
self._save_lazy_ts()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue