mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-14 21:54:22 -06:00
We've already filtered to just files, remove extra handling
This commit is contained in:
@@ -157,14 +157,10 @@ class FileStabilityTracker:
|
|||||||
|
|
||||||
# File is stable - verify it's a regular file
|
# File is stable - verify it's a regular file
|
||||||
try:
|
try:
|
||||||
if path.is_file():
|
path.stat()
|
||||||
to_yield.append(path)
|
to_yield.append(path)
|
||||||
logger.info(f"File is stable: {path}")
|
logger.info(f"File is stable: {path}")
|
||||||
else:
|
except OSError as e: # pragma: no cover
|
||||||
# Not a regular file (directory, symlink, etc.)
|
|
||||||
to_remove.append(path)
|
|
||||||
logger.debug(f"Path is not a regular file: {path}")
|
|
||||||
except OSError as e:
|
|
||||||
logger.warning(f"Cannot access {path}: {e}")
|
logger.warning(f"Cannot access {path}: {e}")
|
||||||
to_remove.append(path)
|
to_remove.append(path)
|
||||||
|
|
||||||
@@ -341,7 +337,7 @@ def _consume_file(
|
|||||||
if subdirs_as_tags:
|
if subdirs_as_tags:
|
||||||
try:
|
try:
|
||||||
tag_ids = _tags_from_path(filepath, consumption_dir)
|
tag_ids = _tags_from_path(filepath, consumption_dir)
|
||||||
except Exception:
|
except Exception: # pragma: no cover
|
||||||
logger.exception(f"Error creating tags from path for {filepath}")
|
logger.exception(f"Error creating tags from path for {filepath}")
|
||||||
|
|
||||||
# Queue for consumption
|
# Queue for consumption
|
||||||
|
|||||||
Reference in New Issue
Block a user