fix: embedding cache key mismatch, scheduler path/exception, log handler leak
embeddings.py: face embedding cache used 'immich' for lookup but 'insightface' for storage, so the cache was never hit for locally- computed embeddings. Unified to 'insightface'/'siglip' throughout. This affects all users since ENABLE_CACHE now defaults to true. scheduler.py: INSIGHTFACE_HOME=/models/.insightface was having '.insightface' appended again, making buffalo_l check always report 'will download'. Also catch BaseException (not just Exception) so a SystemExit from a library call can't silently kill all future runs. log_config.py: handlers.clear() abandoned open FileHandler fds on each scheduled main() call. Close each handler properly before removal. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -26,10 +26,12 @@ def setup_logging(verbose: bool = False) -> logging.Logger:
|
||||
"""Configure logging with Rich console and file output."""
|
||||
level = logging.DEBUG if verbose else logging.INFO
|
||||
|
||||
# Configure root logger
|
||||
# Configure root logger; close existing handlers before replacing them
|
||||
root = logging.getLogger()
|
||||
root.setLevel(level)
|
||||
root.handlers.clear()
|
||||
for h in root.handlers[:]:
|
||||
h.close()
|
||||
root.removeHandler(h)
|
||||
|
||||
# Rich console handler - uses shared console to avoid breaking progress bars
|
||||
root.addHandler(RichHandler(rich_tracebacks=True, markup=True, console=console))
|
||||
|
||||
Reference in New Issue
Block a user