mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2026-04-06 13:11:28 +02:00
fix: invalidate CK price cache after GitHub download so prices load without restart
Some checks are pending
CI / build (push) Waiting to run
Some checks are pending
CI / build (push) Waiting to run
This commit is contained in:
parent
6ecd45117f
commit
33aced3c97
9 changed files with 39 additions and 4 deletions
|
|
@ -172,6 +172,14 @@ async def download_github():
|
|||
msg = f"Downloaded {len(downloaded)} file(s) from GitHub"
|
||||
if failed:
|
||||
msg += f" ({len(failed)} unavailable)"
|
||||
# Invalidate in-memory CK price cache if the file was downloaded
|
||||
# so the singleton reloads it without a container restart.
|
||||
if any("ck_prices_cache.json" in f for f in downloaded):
|
||||
try:
|
||||
from code.web.services.price_service import get_price_service
|
||||
get_price_service().invalidate_ck_cache()
|
||||
except Exception:
|
||||
pass
|
||||
return JSONResponse({
|
||||
"ok": True,
|
||||
"message": msg,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue