From 9af8d4f18673f755cde807ae03a78c62f091c543 Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Thu, 9 Nov 2023 08:15:21 -0800 Subject: [PATCH] Adds documentation of the new arguments --- docs/administration.md | 11 +++++++---- src/documents/management/commands/mixins.py | 5 +++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/administration.md b/docs/administration.md index 99dddb280..982c9e007 100644 --- a/docs/administration.md +++ b/docs/administration.md @@ -414,6 +414,9 @@ This command takes no arguments. Use this command to re-create document thumbnails. Optionally include the ` --document {id}` option to generate thumbnails for a specific document only. +You may also specify `--processes` to control the number of processes used to generate new thumbnails. The default is to utilize +a quarter of the available processors. + ``` document_thumbnails ``` @@ -591,7 +594,7 @@ take into account by the detection. document_fuzzy_match [--ratio] [--processes N] ``` -| Option | Required | Default | Description | -| ----------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------ | -| --ratio | No | 85.0 | a number between 0 and 100, setting how similar a document must be for it to be reported. Higher numbers mean more similarity. | -| --processes | No | 4 | Number of processes to use for matching. Setting 1 disables multiple processes | +| Option | Required | Default | Description | +| ----------- | -------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------ | +| --ratio | No | 85.0 | a number between 0 and 100, setting how similar a document must be for it to be reported. Higher numbers mean more similarity. | +| --processes | No | 1/4 of system cores | Number of processes to use for matching. Setting 1 disables multiple processes | diff --git a/src/documents/management/commands/mixins.py b/src/documents/management/commands/mixins.py index 6532e7a3a..6fed739b8 100644 --- a/src/documents/management/commands/mixins.py +++ b/src/documents/management/commands/mixins.py @@ -1,4 +1,5 @@ import os +from argparse import ArgumentParser from django.core.management import CommandError @@ -9,7 +10,7 @@ class MultiProcessMixin: for the use of multiple processes """ - def add_argument_processes_mixin(self, parser): + def add_argument_processes_mixin(self, parser: ArgumentParser): parser.add_argument( "--processes", default=max(1, os.cpu_count() // 4), @@ -29,7 +30,7 @@ class ProgressBarMixin: via this class """ - def add_argument_progress_bar_mixin(self, parser): + def add_argument_progress_bar_mixin(self, parser: ArgumentParser): parser.add_argument( "--no-progress-bar", default=False,