mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-26 06:37:07 +00:00
Every cached item got a 7-day expiry at store time. A popular tarball left the cache seven days after it was cached, however often clients requested it. Artifacts now get no age-based expiry. Cleanup removes any item whose last_accessed is older than cache.idle_ttl (default 168h, 0 disables). It reads the items in bounded batches of 500 through the indexed last_accessed column and deletes them through deletePackage. Metadata entries keep the freshness expiry from default_ttl. Startup and each cleanup run clear the expiry that earlier versions set on artifact rows. Cleanup records the idle and ttl eviction reasons and logs the count and bytes freed. The stats API reports idle_ttl in seconds. Package deletes are soft deletes and no history table has a foreign key to packages, so download history stays intact.