File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 37
37
38
38
39
39
def _get_files_from_cache_entry (
40
- cache_entry : database .CacheEntry , key : str = "file:size"
40
+ cache_entry : database .CacheEntry , key : str | None
41
41
) -> dict [str , Any ]:
42
42
result = cache_entry .result
43
43
if not isinstance (result , (list , tuple , set )):
@@ -51,7 +51,10 @@ def _get_files_from_cache_entry(
51
51
and obj ["callable" ] in FILE_RESULT_CALLABLES
52
52
):
53
53
fs , urlpath = extra_encoders ._get_fs_and_urlpath (* obj ["args" ][:2 ])
54
- files [fs .unstrip_protocol (urlpath )] = obj ["args" ][0 ][key ]
54
+ value = obj ["args" ][0 ]
55
+ if key is not None :
56
+ value = value [key ]
57
+ files [fs .unstrip_protocol (urlpath )] = value
55
58
return files
56
59
57
60
@@ -257,7 +260,7 @@ def delete_cache_files(
257
260
for cache_entry in session .scalars (
258
261
sa .select (database .CacheEntry ).filter (* filters ).order_by (* sorters )
259
262
):
260
- files = _get_files_from_cache_entry (cache_entry )
263
+ files = _get_files_from_cache_entry (cache_entry , key = "file:size" )
261
264
if any (file .startswith (self .urldir ) for file in files ):
262
265
entries_to_delete .append (cache_entry )
263
266
for file in files :
You can’t perform that action at this time.
0 commit comments