|
@@ -776,6 +776,12 @@ async def is_cache_generation_needed_async():
|
|
|
|
|
|
|
|
if pattern_set != metadata_keys:
|
|
if pattern_set != metadata_keys:
|
|
|
# Metadata is missing some patterns
|
|
# Metadata is missing some patterns
|
|
|
|
|
+ missing_metadata = pattern_set - metadata_keys
|
|
|
|
|
+ extra_metadata = metadata_keys - pattern_set
|
|
|
|
|
+ if missing_metadata:
|
|
|
|
|
+ logger.info(f"Cache needed: {len(missing_metadata)} patterns missing from metadata cache")
|
|
|
|
|
+ if extra_metadata:
|
|
|
|
|
+ logger.info(f"Cache needed: {len(extra_metadata)} patterns in metadata but not on disk")
|
|
|
return True
|
|
return True
|
|
|
|
|
|
|
|
# Step 3: Check image cache
|
|
# Step 3: Check image cache
|
|
@@ -793,10 +799,17 @@ async def is_cache_generation_needed_async():
|
|
|
|
|
|
|
|
if pattern_set != cached_images:
|
|
if pattern_set != cached_images:
|
|
|
# Some patterns missing image cache
|
|
# Some patterns missing image cache
|
|
|
|
|
+ missing_images = pattern_set - cached_images
|
|
|
|
|
+ extra_images = cached_images - pattern_set
|
|
|
|
|
+ if missing_images:
|
|
|
|
|
+ logger.info(f"Cache needed: {len(missing_images)} patterns missing image cache")
|
|
|
|
|
+ if extra_images:
|
|
|
|
|
+ logger.info(f"Cache needed: {len(extra_images)} cached images without patterns")
|
|
|
return True
|
|
return True
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ logger.info(f"Cache is up to date ({len(pattern_set)} patterns)")
|
|
|
return False
|
|
return False
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
logger.warning(f"Error checking cache status: {e}")
|
|
logger.warning(f"Error checking cache status: {e}")
|
|
|
return False # Don't block startup on errors
|
|
return False # Don't block startup on errors
|