mirror of
https://github.com/flatpak/flatpak.git
synced 2026-04-03 14:56:47 -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>
(cherry picked from commit 63b4f3a5c1)
This commit is contained in:
committed by
Alexander Larsson
parent
1ab69d7032
commit
7a1c268405
@@ -10605,6 +10605,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