mirror of
https://github.com/nirvana-7777/script.service.ultimate.git
synced 2026-10-08 08:52:14 +02:00
streamline mpd rewrite
This commit is contained in:
@@ -76,8 +76,17 @@ class MPDCacheManager:
|
||||
logger.debug(
|
||||
f"Cache expired for {cache_key} (expired {staleness}s ago)"
|
||||
)
|
||||
self.vfs.delete(manifest_file)
|
||||
self.vfs.delete(meta_file)
|
||||
# Deliberately NOT deleting the expired files here. This get()
|
||||
# call may have been made with the default max_stale=0 (a
|
||||
# normal cache lookup), but a *different* caller further down
|
||||
# the request chain may retry with max_stale>0 as a
|
||||
# last-resort fallback after a live refetch fails. If we
|
||||
# delete on every plain expiry check, that fallback caller
|
||||
# always finds nothing — the fallback only ever worked when
|
||||
# it happened to be the first caller to see the expired
|
||||
# entry. Expired entries are reaped on their own schedule by
|
||||
# clear_expired() instead, so both call patterns keep working
|
||||
# regardless of ordering.
|
||||
return None
|
||||
|
||||
manifest_content = self.vfs.read_text(manifest_file)
|
||||
@@ -264,4 +273,4 @@ class MPDCacheManager:
|
||||
return meta
|
||||
except Exception as e:
|
||||
logger.debug(f"Error getting cache info for {cache_key}: {e}")
|
||||
return None
|
||||
return None
|
||||
Reference in New Issue
Block a user