diskcache has a peekitem method that allows you to lookup the expire_time of a cached item without changing it. I recently used this to implement debounce for fastapi background tasks with multiple workers running. since all the workers I care about are on the same machine, but running in different processes diskcache was a great option. All workers have access to the same disk, but not the same variables in memory.
-
@waylonwalker
2024
DiskCache API Reference — DiskCache 5.6.1 doc ...
https://grantjenks.com/docs/diskcache/api.html#diskcache.Cache.peekite ...
You found my thought's a collection of short posts generally tied to a link on the web and written through a small chrome extension. See full posts on waylonwalker.com