mirror of
https://github.com/flatpak/flatpak.git
synced 2026-03-24 09:52:48 -04:00
dir: Fix caching of summary files
Cache hits didn’t result in the cache entry’s timeout being extended, and timeouts didn’t result in the entry being removed from the cache to free up resources (even though it would never be returned as a cache hit again). Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
committed by
Alexander Larsson
parent
9bec865995
commit
63b4f3a5c1
@@ -10606,6 +10606,15 @@ flatpak_dir_lookup_cached_summary (FlatpakDir *self,
|
||||
*bytes_sig_out = NULL;
|
||||
}
|
||||
res = TRUE;
|
||||
|
||||
/* Bump the cache expiry time */
|
||||
summary->time = now;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Timed out or URL has changed; remove the entry */
|
||||
g_hash_table_remove (self->summary_cache, name);
|
||||
res = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user