fix: address code review — unused import, silent except, gallery cache
- Remove unused `patch` import from test_output_dir.py - Add debug log message to ImportError handler instead of bare pass - Invalidate gallery file listing cache alongside output dir cache when the user changes gallery_root_path in settings
This commit is contained in:
+3
-1
@@ -482,7 +482,9 @@ class PromptManagerAPI(
|
||||
f"Configured directory does not exist: {GalleryConfig.MONITORING_DIRECTORIES[0]}"
|
||||
)
|
||||
except ImportError:
|
||||
pass
|
||||
self.logger.debug(
|
||||
"GalleryConfig not available, skipping configured directory check"
|
||||
)
|
||||
|
||||
current_file = Path(__file__).resolve()
|
||||
self.logger.debug(f"Starting ComfyUI output search from: {current_file}")
|
||||
|
||||
+3
-1
@@ -448,8 +448,10 @@ class AdminRoutesMixin:
|
||||
GalleryConfig.MONITORING_DIRECTORIES = [new_path]
|
||||
else:
|
||||
GalleryConfig.MONITORING_DIRECTORIES = []
|
||||
# Invalidate cached output dir so next lookup uses new config
|
||||
# Invalidate caches so next lookup uses new config
|
||||
self._cached_output_dir = None
|
||||
self._gallery_cache = None
|
||||
self._gallery_cache_time = 0
|
||||
restart_required = True
|
||||
|
||||
# Save to config file for persistence
|
||||
|
||||
Reference in New Issue
Block a user