diff --git a/docs/configuration.md b/docs/configuration.md index 59e7af64c..83a477e86 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1181,6 +1181,7 @@ using Python's `re.match()`, which anchors at the start of the filename. See the [watchfiles documentation](https://watchfiles.helpmanual.io/api/filters/#watchfiles.BaseFilter.ignore_entity_patterns) This setting is for additional patterns beyond the built-in defaults. Common system files and directories are already ignored automatically. + The patterns will be compiled via Python's standard `re` module. Example custom patterns: @@ -1212,7 +1213,7 @@ using Python's `re.match()`, which anchors at the start of the filename. Defaults to `[]` (empty list, uses only built-in defaults). - The default ignores are `[.DS_Store, .DS_STORE, ._*, desktop.ini, Thumbs.db]` and cannot be overridden. + The default ignores are `[.stfolder, .stversions, .localized, @eaDir, .Spotlight-V100, .Trashes, __MACOSX]` and cannot be overridden. #### [`PAPERLESS_CONSUMER_BARCODE_SCANNER=`](#PAPERLESS_CONSUMER_BARCODE_SCANNER) {#PAPERLESS_CONSUMER_BARCODE_SCANNER} diff --git a/docs/migration.md b/docs/migration.md index 8953df919..2ef850cbe 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -9,11 +9,11 @@ separating the directory ignore from the file ignore. ### Summary -| Old Setting | New Setting | Notes | -| ------------------------------ | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `CONSUMER_POLLING` | [`CONSUMER_POLLING_INTERVAL`](configuration.md#PAPERLESS_CONSUMER_POLLING_INTERVAL) | Renamed for clarity | -| `CONSUMER_INOTIFY_DELAY` | [`CONSUMER_STABILITY_DELAY`](configuration.md#PAPERLESS_CONSUMER_STABILITY_DELAY) | Unified for all modes | -| `CONSUMER_POLLING_DELAY` | _Removed_ | Use `CONSUMER_STABILITY_DELAY` | -| `CONSUMER_POLLING_RETRY_COUNT` | _Removed_ | Automatic with stability tracking | -| `CONSUMER_IGNORE_PATTERNS` | [`CONSUMER_IGNORE_PATTERNS`](configuration.md#PAPERLESS_CONSUMER_IGNORE_PATTERNS) | **Now regex, not fnmatch** and appended to the default ignore patterns | -| _New_ | [`CONSUMER_IGNORE_DIRS`](configuration.md#PAPERLESS_CONSUMER_IGNORE_DIRS) | Additional directories to ignore and appended to the default ignore names | +| Old Setting | New Setting | Notes | +| ------------------------------ | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | +| `CONSUMER_POLLING` | [`CONSUMER_POLLING_INTERVAL`](configuration.md#PAPERLESS_CONSUMER_POLLING_INTERVAL) | Renamed for clarity | +| `CONSUMER_INOTIFY_DELAY` | [`CONSUMER_STABILITY_DELAY`](configuration.md#PAPERLESS_CONSUMER_STABILITY_DELAY) | Unified for all modes | +| `CONSUMER_POLLING_DELAY` | _Removed_ | Use `CONSUMER_STABILITY_DELAY` | +| `CONSUMER_POLLING_RETRY_COUNT` | _Removed_ | Automatic with stability tracking | +| `CONSUMER_IGNORE_PATTERNS` | [`CONSUMER_IGNORE_PATTERNS`](configuration.md#PAPERLESS_CONSUMER_IGNORE_PATTERNS) | **Now regex, not fnmatch**; user patterns are added to (not replacing) default ones | +| _New_ | [`CONSUMER_IGNORE_DIRS`](configuration.md#PAPERLESS_CONSUMER_IGNORE_DIRS) | Additional directories to ignore; user entries are added to (not replacing) defaults | diff --git a/paperless.conf.example b/paperless.conf.example index 8dee8289a..424f6cce9 100644 --- a/paperless.conf.example +++ b/paperless.conf.example @@ -58,7 +58,7 @@ #PAPERLESS_CONSUMER_POLLING_INTERVAL=10 #PAPERLESS_CONSUMER_DELETE_DUPLICATES=false #PAPERLESS_CONSUMER_RECURSIVE=false -#PAPERLESS_CONSUMER_IGNORE_PATTERNS=[".DS_STORE/*", "._*", ".stfolder/*", ".stversions/*", ".localized/*", "desktop.ini"] +#PAPERLESS_CONSUMER_IGNORE_PATTERNS=[] # Defaults are built in; add filename regexes, e.g. ["^\\.DS_Store$", "^desktop\\.ini$"] #PAPERLESS_CONSUMER_SUBDIRS_AS_TAGS=false #PAPERLESS_CONSUMER_ENABLE_BARCODES=false #PAPERLESS_CONSUMER_BARCODE_STRING=PATCHT diff --git a/src/documents/tests/test_management_consumer.py b/src/documents/tests/test_management_consumer.py index 8e7f97fa4..73b5464b0 100644 --- a/src/documents/tests/test_management_consumer.py +++ b/src/documents/tests/test_management_consumer.py @@ -830,7 +830,7 @@ class TestCommandWatchPolling: """Tests for polling mode.""" @pytest.mark.django_db - @pytest.mark.flaky(reruns=5) + @pytest.mark.flaky(reruns=2) def test_polling_mode_works( self, consumption_dir: Path, @@ -838,7 +838,10 @@ class TestCommandWatchPolling: mock_consume_file_delay: MagicMock, start_consumer: Callable[..., ConsumerThread], ) -> None: - """Test polling mode detects files.""" + """ + Test polling mode detects files. + Note: At times, there appears to be a timing issue, where delay has not yet been called, hence this is marked as flaky. + """ # Use shorter polling interval for faster test thread = start_consumer(polling_interval=0.5, stability_delay=0.1)