pub async fn purge_previews(
pool: &PgPool,
dir: &Path,
max_bytes: u64,
) -> AppResult<PreviewPurge>Expand description
Trims the preview cache (<vault>/previews): removes the previews and
thumbnails of blobs the database no longer refers to, files of older
cache versions and temporary files older than an hour; then, with
max_bytes > 0, the least recently used files until the cache fits.
Files with other names are left alone. Everything removed is made again
when it is needed.