2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-04-15 07:48:51 +00:00

Worker debugging (#11677)

* Add debugging info for background workers to the devcontainer docs

* Add debugging info the the EventMixin docs

* Add an option to set sync=True to launch.json
This commit is contained in:
gunstr
2026-04-10 03:38:35 +02:00
committed by GitHub
parent 01bb113396
commit 16310617be
4 changed files with 23 additions and 3 deletions

View File

@@ -865,6 +865,16 @@ BACKGROUND_WORKER_ATTEMPTS = int(
get_setting('INVENTREE_BACKGROUND_MAX_ATTEMPTS', 'background.max_attempts', 5)
)
# Check if '--sync' was passed in the command line
if '--sync' in sys.argv and '--noreload' in sys.argv and DEBUG:
SYNC_TASKS = True
else:
SYNC_TASKS = False
# Clean up sys.argv so Django doesn't complain about an unknown argument
if SYNC_TASKS:
sys.argv.remove('--sync')
# django-q background worker configuration
Q_CLUSTER = {
'name': 'InvenTree',
@@ -879,7 +889,7 @@ Q_CLUSTER = {
'bulk': 10,
'orm': 'default',
'cache': 'default',
'sync': False,
'sync': SYNC_TASKS,
'poll': 1.5,
}