From 1b858b9e65cf045ab254583d190d9fdebe0e9b70 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 16:11:20 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- plugins/contents/fps_contents/fileid.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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,))