mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-12 21:44:21 -06:00
Don't try to even track not files
This commit is contained in:
@@ -182,10 +182,6 @@ class FileStabilityTracker:
|
||||
"""Check if there are files waiting for stability check."""
|
||||
return len(self._tracked) > 0
|
||||
|
||||
def clear(self) -> None:
|
||||
"""Clear all tracked files."""
|
||||
self._tracked.clear()
|
||||
|
||||
@property
|
||||
def pending_count(self) -> int:
|
||||
"""Number of files being tracked."""
|
||||
@@ -540,6 +536,8 @@ class Command(BaseCommand):
|
||||
# Process each change
|
||||
for change_type, path in changes:
|
||||
path = Path(path).resolve()
|
||||
if not path.is_file():
|
||||
continue
|
||||
logger.debug(f"Event: {change_type.name} for {path}")
|
||||
tracker.track(path, change_type)
|
||||
|
||||
|
||||
@@ -278,18 +278,6 @@ class TestFileStabilityTracker:
|
||||
assert len(stable) == 1
|
||||
assert stable[0] == file2
|
||||
|
||||
def test_clear(
|
||||
self,
|
||||
stability_tracker: FileStabilityTracker,
|
||||
temp_file: Path,
|
||||
) -> None:
|
||||
"""Test clear removes all tracked files."""
|
||||
stability_tracker.track(temp_file, Change.added)
|
||||
assert stability_tracker.pending_count == 1
|
||||
stability_tracker.clear()
|
||||
assert stability_tracker.pending_count == 0
|
||||
assert stability_tracker.has_pending_files() is False
|
||||
|
||||
def test_track_resolves_path(
|
||||
self,
|
||||
stability_tracker: FileStabilityTracker,
|
||||
|
||||
Reference in New Issue
Block a user