mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 08:15:27 +01:00
Add --no-progress-bar option to commands
This commit is contained in:
parent
17b9d7eb42
commit
dc26c9b7cc
10 changed files with 83 additions and 21 deletions
|
|
@ -10,10 +10,16 @@ class Command(BaseCommand):
|
|||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument("command", choices=['reindex', 'optimize'])
|
||||
parser.add_argument(
|
||||
"--no-progress-bar",
|
||||
default=False,
|
||||
action="store_true",
|
||||
help="If set, the progress bar will not be shown"
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
with transaction.atomic():
|
||||
if options['command'] == 'reindex':
|
||||
index_reindex()
|
||||
index_reindex(progress_bar_disable=options['no_progress_bar'])
|
||||
elif options['command'] == 'optimize':
|
||||
index_optimize()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue