You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is everything ok with remove_all cleanuping option for file cache?
According docs: When set to true (...) it will remove complete level directories for file caches instead of comparing each tile with a timestamp.
Actual Behavior
But if remove_all is set to True, max_mtime = self.expire_timestamp(tile) equals 0 and tiles timestamp comparison is still performed,
so the condition stale = int(tile.timestamp) <= max_mtime evaluates to False and is_cached() returns True.
Thanks for reporting this! In my opinion the behavior of is_cached is correct, but is_stale should return True instead of False. I will look into this.
Edit: I think the description of is_cached is wrong and should actually be: Return True if the tile exists _and_ is not expired.
Context
Is everything ok with
remove_all
cleanuping option forfile
cache?According docs: When set to true (...) it will remove complete level directories for file caches instead of comparing each tile with a timestamp.
Actual Behavior
But if
remove_all
is set toTrue
,max_mtime = self.expire_timestamp(tile)
equals0
and tiles timestamp comparison is still performed,so the condition
stale = int(tile.timestamp) <= max_mtime
evaluates toFalse
andis_cached()
returnsTrue
.mapproxy/mapproxy/cache/tile.py
Lines 228 to 245 in f3b976d
Then
is_stale()
returnsFalse
, which means that the tile has not expired and shouldn't be removemapproxy/mapproxy/cache/tile.py
Lines 247 to 259 in f3b976d
Your Environment
The text was updated successfully, but these errors were encountered: