mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-14 21:54:22 -06:00
Adjusting the settings names now
This commit is contained in:
@@ -424,11 +424,11 @@ class Command(BaseCommand):
|
|||||||
settings.SCRATCH_DIR.mkdir(parents=True, exist_ok=True)
|
settings.SCRATCH_DIR.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
# Get settings
|
# Get settings
|
||||||
recursive: bool = getattr(settings, "CONSUMER_RECURSIVE", False)
|
recursive: bool = settings.CONSUMER_RECURSIVE
|
||||||
subdirs_as_tags: bool = getattr(settings, "CONSUMER_SUBDIRS_AS_TAGS", False)
|
subdirs_as_tags: bool = settings.CONSUMER_SUBDIRS_AS_TAGS
|
||||||
polling_interval: float = getattr(settings, "CONSUMER_POLLING_INTERVAL", 0)
|
polling_interval: float = settings.CONSUMER_POLLING_INTERVAL
|
||||||
stability_delay: float = getattr(settings, "CONSUMER_STABILITY_DELAY", 1.0)
|
stability_delay: float = settings.CONSUMER_STABILITY_DELAY
|
||||||
ignore_patterns: list[str] = getattr(settings, "CONSUMER_IGNORE_PATTERNS", [])
|
ignore_patterns: list[str] = settings.CONSUMER_IGNORE_PATTERNS
|
||||||
is_testing: bool = options.get("testing", False)
|
is_testing: bool = options.get("testing", False)
|
||||||
is_oneshot: bool = options.get("oneshot", False)
|
is_oneshot: bool = options.get("oneshot", False)
|
||||||
|
|
||||||
|
|||||||
@@ -716,7 +716,7 @@ def start_consumer(
|
|||||||
if thread.is_alive():
|
if thread.is_alive():
|
||||||
failed_threads.append(thread)
|
failed_threads.append(thread)
|
||||||
|
|
||||||
# Clean up any Tags created by threads (they bypass test transaction isolation)
|
# Clean up any Tags created by threads
|
||||||
Tag.objects.all().delete()
|
Tag.objects.all().delete()
|
||||||
|
|
||||||
if failed_threads:
|
if failed_threads:
|
||||||
|
|||||||
@@ -275,6 +275,8 @@ class TestExportImport(
|
|||||||
|
|
||||||
call_command("document_importer", "--no-progress-bar", self.target)
|
call_command("document_importer", "--no-progress-bar", self.target)
|
||||||
self.assertEqual(Document.objects.count(), 4)
|
self.assertEqual(Document.objects.count(), 4)
|
||||||
|
for tag in Tag.objects.all():
|
||||||
|
print(f"id: {tag.pk}: {tag.name}")
|
||||||
self.assertEqual(Tag.objects.count(), 1)
|
self.assertEqual(Tag.objects.count(), 1)
|
||||||
self.assertEqual(Correspondent.objects.count(), 1)
|
self.assertEqual(Correspondent.objects.count(), 1)
|
||||||
self.assertEqual(DocumentType.objects.count(), 1)
|
self.assertEqual(DocumentType.objects.count(), 1)
|
||||||
|
|||||||
@@ -1044,24 +1044,15 @@ IGNORABLE_FILES: Final[list[str]] = [
|
|||||||
"Thumbs.db",
|
"Thumbs.db",
|
||||||
]
|
]
|
||||||
|
|
||||||
CONSUMER_POLLING = int(os.getenv("PAPERLESS_CONSUMER_POLLING", 0))
|
CONSUMER_POLLING_INTERVAL = float(os.getenv("PAPERLESS_CONSUMER_POLLING_INTERVAL", 0))
|
||||||
|
|
||||||
CONSUMER_POLLING_DELAY = int(os.getenv("PAPERLESS_CONSUMER_POLLING_DELAY", 5))
|
CONSUMER_STABILITY_DELAY = float(os.getenv("PAPERLESS_CONSUMER_STABILITY_DELAY", 5))
|
||||||
|
|
||||||
CONSUMER_POLLING_RETRY_COUNT = int(
|
|
||||||
os.getenv("PAPERLESS_CONSUMER_POLLING_RETRY_COUNT", 5),
|
|
||||||
)
|
|
||||||
|
|
||||||
CONSUMER_INOTIFY_DELAY: Final[float] = __get_float(
|
|
||||||
"PAPERLESS_CONSUMER_INOTIFY_DELAY",
|
|
||||||
0.5,
|
|
||||||
)
|
|
||||||
|
|
||||||
CONSUMER_DELETE_DUPLICATES = __get_boolean("PAPERLESS_CONSUMER_DELETE_DUPLICATES")
|
CONSUMER_DELETE_DUPLICATES = __get_boolean("PAPERLESS_CONSUMER_DELETE_DUPLICATES")
|
||||||
|
|
||||||
CONSUMER_RECURSIVE = __get_boolean("PAPERLESS_CONSUMER_RECURSIVE")
|
CONSUMER_RECURSIVE = __get_boolean("PAPERLESS_CONSUMER_RECURSIVE")
|
||||||
|
|
||||||
# Ignore glob patterns, relative to PAPERLESS_CONSUMPTION_DIR
|
# Ignore regex patterns, relative to PAPERLESS_CONSUMPTION_DIR
|
||||||
CONSUMER_IGNORE_PATTERNS = list(
|
CONSUMER_IGNORE_PATTERNS = list(
|
||||||
json.loads(
|
json.loads(
|
||||||
os.getenv(
|
os.getenv(
|
||||||
|
|||||||
Reference in New Issue
Block a user