mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-12-01 07:05:24 +00:00
A scanner binary that its timeout kills cannot remove its own temp files. A killed trivy left its database download in the temp dir as trivy-<n> and getter<n>, up to 279 MB for each scan. Concurrent rescans filled the scanner temp dir, and the disk guard then refused all new scans. Each scanner run now gets a private dir in the temp dir, and the scanner binary gets this dir as TMPDIR. The scan removes the dir and its contents when the scan ends, also after a timeout or an error. Each new scan also removes abandoned dirs that are older than one hour. These dirs come from a process that stopped during a scan, or from a removal that failed.