From 45e6bf859f6e3836b8989d51756bd2a093054079 Mon Sep 17 00:00:00 2001 From: Roland Date: Fri, 16 Dec 2022 10:42:03 -0700 Subject: [PATCH] Allowing refresh of directory which does not exist (it was deleted). --- wrolpi/files/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrolpi/files/lib.py b/wrolpi/files/lib.py index 620c31dc..137b7cd2 100644 --- a/wrolpi/files/lib.py +++ b/wrolpi/files/lib.py @@ -377,7 +377,7 @@ async def refresh_directory_files_recursively(directory: Union[pathlib.Path, str Any records of the files that are no longer in the directory will be removed.""" if isinstance(directory, str): directory = pathlib.Path(directory) - if not directory.is_dir(): + if directory.is_file(): raise ValueError(f'Cannot refresh files of a file: {directory=}') # All Files older than this will be removed.