The previous in-memory dict only worked with a single gunicorn worker. With workers=2 in gunicorn_config.py, the async-search worker stored the result in its own process memory while the dashboard request landed on the other worker ~50% of the time — cache miss → fell through to a synchronous Box fetch → exceeded the GCP load balancer's 30s timeout, returning "stream timeout" to the user even though the search itself succeeded. Now stores cache entries as pickled files at storage/cache/<key>.pkl, shared across workers via the existing volume mount. Atomic writes via tempfile + os.replace. TTL still 30 minutes. Public API (cache_set/get/delete/cleanup) is unchanged so call sites in reporting/routes.py continue to work. |
||
|---|---|---|
| .. | ||
| campaigns | ||
| hm_qc | ||
| printer_check | ||
| reporting | ||
| usage | ||
| video_master | ||
| video_qc | ||
| __init__.py | ||