From 118bc63b6b4b1866beeffb87a0fb54238d40d197 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 4 May 2026 21:15:42 +1000 Subject: [PATCH] Enable verbosity option for worker command (#11862) --- tasks.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tasks.py b/tasks.py index 64b961fc3e..23470bf186 100644 --- a/tasks.py +++ b/tasks.py @@ -1553,10 +1553,16 @@ def server(c, address='0.0.0.0:8000', no_reload=False, no_threading=False): manage(c, cmd, pty=True) -@task(pre=[wait]) -def worker(c): - """Run the InvenTree background worker process.""" - manage(c, 'qcluster', pty=True) +@task(pre=[wait], help={'verbose': 'Print verbose output from the command'}) +def worker(c, verbose: bool = False): + """Run the InvenTree background worker process. + + Launches a django-q2 cluster to process background tasks. + Ref: https://django-q2.readthedocs.io + """ + cmd = f'qcluster -v {2 if verbose else 0}' + + manage(c, cmd, pty=True) @task(post=[static, server])