Skip to content

Commit fe1f221

Browse files
committed
Log a warning when rqworker invoked without specified queues
1 parent d3b4a72 commit fe1f221

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
+12-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
from django.conf import settings
1+
import logging
2+
23
from django_rq.management.commands.rqworker import Command as _Command
34

45

6+
DEFAULT_QUEUES = ('high', 'default', 'low')
7+
8+
logger = logging.getLogger('netbox.rqworker')
9+
10+
511
class Command(_Command):
612
"""
713
Subclass django_rq's built-in rqworker to listen on all configured queues if none are specified (instead
@@ -11,6 +17,10 @@ def handle(self, *args, **options):
1117

1218
# If no queues have been specified on the command line, listen on all configured queues.
1319
if len(args) < 1:
14-
args = settings.RQ_QUEUES
20+
queues = ', '.join(DEFAULT_QUEUES)
21+
logger.warning(
22+
f"No queues have been specified. This process will service the following queues by default: {queues}"
23+
)
24+
args = DEFAULT_QUEUES
1525

1626
super().handle(*args, **options)

0 commit comments

Comments
 (0)