I use proxpi to keep CI pipelines working during network outages. When the host server restarts, in-memory index cache is lost. A subsequent request during a network outage then fails, even though the entry was still within TTL and PROXPI_CACHE_DIR was configured, because index data was never written to disk, only cached in memory.
- CACHE_DIR is set, but only package file downloads appear to persist there. The index (package list/metadata) cache lives in memory only (using a python dict).
- On restart, in-memory cache is empty, so any request during a subsequent outage fails instead of falling back to the last-known-good index.
- No workaround currently besides avoiding restarts during outages.
Propousal
Use sqlitedict instead of dict for the _IndexCache class. Reuse the PROXPI_CACHE_DIR to save the index.
I use proxpi to keep CI pipelines working during network outages. When the host server restarts, in-memory index cache is lost. A subsequent request during a network outage then fails, even though the entry was still within TTL and PROXPI_CACHE_DIR was configured, because index data was never written to disk, only cached in memory.
Propousal
Use
sqlitedictinstead ofdictfor the_IndexCacheclass. Reuse the PROXPI_CACHE_DIR to save the index.