Allowing refresh of directory which does not exist (it was deleted).

This commit is contained in:
Roland 2022-12-16 10:42:03 -07:00
parent b40db1a1b1
commit 45e6bf859f
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93

View file

@ -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.