mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-03-13 04:31:23 +00:00
Disables the system checks for most of our commands, as the image has already run them, so we're good enough without them
This commit is contained in:
@@ -72,6 +72,30 @@ PAPERLESS_DBHOST: postgres
|
||||
|
||||
See [`PAPERLESS_DBENGINE`](configuration.md#PAPERLESS_DBENGINE) for accepted values.
|
||||
|
||||
## Management Command: `--skip-checks` Removed
|
||||
|
||||
The `--skip-checks` flag has been removed from all Paperless-ngx management commands
|
||||
(`document_exporter`, `document_importer`, `document_retagger`, `document_archiver`,
|
||||
`document_thumbnails`, `document_index`, `document_renamer`, `document_sanity_checker`,
|
||||
`document_fuzzy_match`, and others).
|
||||
|
||||
These commands now set `requires_system_checks = []` internally, which both skips
|
||||
redundant checks at runtime (they are already run as a dedicated step during Docker
|
||||
startup via `init-system-checks`) and removes `--skip-checks` from the argument parser.
|
||||
|
||||
#### Action Required
|
||||
|
||||
Remove `--skip-checks` from any scripts, cron jobs, or automation that invokes
|
||||
these commands:
|
||||
|
||||
```bash
|
||||
# v2
|
||||
document_exporter /backup --skip-checks
|
||||
|
||||
# v3
|
||||
document_exporter /backup
|
||||
```
|
||||
|
||||
## Database Advanced Options
|
||||
|
||||
The individual SSL, timeout, and pooling variables have been removed in favor of a
|
||||
|
||||
@@ -151,6 +151,10 @@ class PaperlessCommand(RichCommand):
|
||||
supports_progress_bar: Adds --no-progress-bar argument (default: True)
|
||||
supports_multiprocessing: Adds --processes argument (default: False)
|
||||
|
||||
System checks are skipped by default (requires_system_checks = []) because
|
||||
these commands run post-startup where checks have already been performed by
|
||||
the application server. Subclasses that genuinely need checks can override.
|
||||
|
||||
Example usage:
|
||||
|
||||
class Command(PaperlessCommand):
|
||||
@@ -189,6 +193,8 @@ class PaperlessCommand(RichCommand):
|
||||
stats.imported += 1
|
||||
"""
|
||||
|
||||
requires_system_checks: ClassVar[list] = []
|
||||
|
||||
supports_progress_bar: ClassVar[bool] = True
|
||||
supports_multiprocessing: ClassVar[bool] = False
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ class Command(CryptMixin, PaperlessCommand):
|
||||
ContentType.objects.all().delete()
|
||||
Permission.objects.all().delete()
|
||||
for manifest_path in self.manifest_paths:
|
||||
call_command("loaddata", manifest_path)
|
||||
call_command("loaddata", manifest_path, skip_checks=True)
|
||||
except (FieldDoesNotExist, DeserializationError, IntegrityError) as e:
|
||||
self.stdout.write(self.style.ERROR("Database import failed"))
|
||||
if (
|
||||
|
||||
@@ -12,7 +12,12 @@ class TestApiSchema(APITestCase):
|
||||
Test that the schema is valid
|
||||
"""
|
||||
try:
|
||||
call_command("spectacular", "--validate", "--fail-on-warn")
|
||||
call_command(
|
||||
"spectacular",
|
||||
"--validate",
|
||||
"--fail-on-warn",
|
||||
skip_checks=True,
|
||||
)
|
||||
except CommandError as e:
|
||||
self.fail(f"Schema validation failed: {e}")
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ class TestCreateClassifier(TestCase):
|
||||
"documents.management.commands.document_create_classifier.train_classifier",
|
||||
)
|
||||
def test_create_classifier(self, m) -> None:
|
||||
call_command("document_create_classifier")
|
||||
call_command("document_create_classifier", skip_checks=True)
|
||||
|
||||
m.assert_called_once()
|
||||
|
||||
@@ -152,7 +152,7 @@ class TestConvertMariaDBUUID(TestCase):
|
||||
m.alter_field.return_value = None
|
||||
|
||||
stdout = StringIO()
|
||||
call_command("convert_mariadb_uuid", stdout=stdout)
|
||||
call_command("convert_mariadb_uuid", stdout=stdout, skip_checks=True)
|
||||
|
||||
m.assert_called_once()
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ class TestManageSuperUser(DirectoriesMixin, TestCase):
|
||||
"--no-color",
|
||||
stdout=out,
|
||||
stderr=StringIO(),
|
||||
skip_checks=True,
|
||||
)
|
||||
return out.getvalue()
|
||||
|
||||
|
||||
@@ -1665,7 +1665,7 @@ class TestManagementCommand(TestCase):
|
||||
"paperless_mail.management.commands.mail_fetcher.tasks.process_mail_accounts",
|
||||
)
|
||||
def test_mail_fetcher(self, m) -> None:
|
||||
call_command("mail_fetcher")
|
||||
call_command("mail_fetcher", skip_checks=True)
|
||||
|
||||
m.assert_called_once()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user