diff --git a/plugins/contents/fps_contents/fileid.py b/plugins/contents/fps_contents/fileid.py index f001f29c..4c0522ef 100644 --- a/plugins/contents/fps_contents/fileid.py +++ b/plugins/contents/fps_contents/fileid.py @@ -8,7 +8,6 @@ from fps.logging import get_configured_logger # type: ignore from watchfiles import Change, awatch - watchfiles_logger = get_configured_logger("watchfiles.main") watchfiles_logger.setLevel(logging.CRITICAL) logger = get_configured_logger("contents") @@ -34,6 +33,7 @@ def notify(self, change): class Singleton(type): _instances = {} + def __call__(cls, *args, **kwargs): if cls not in cls._instances: cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) @@ -133,7 +133,9 @@ async def watch_files(self): logger.debug("File %s is not indexed, ignoring", changed_path_str) continue mtime = (await changed_path.stat()).st_mtime - await db.execute("UPDATE fileids SET mtime = ? WHERE path = ?", (mtime, changed_path_str)) + await db.execute( + "UPDATE fileids SET mtime = ? WHERE path = ?", (mtime, changed_path_str) + ) for path in deleted_paths + added_paths: await db.execute("DELETE FROM fileids WHERE path = ?", (path,))