@@ -0,0 +1,1614 @@
+import sys%0Aimport logging%0Aimport argparse%0A%0Afrom django.core.management.base import BaseCommand, CommandError%0A%0Afrom ...worker import Worker%0A%0A%0Aclass Command(BaseCommand):%0A    help = %22Run an individual queue worker%22%0A%0A    def add_arguments(self, parser):%0A        parser.add_argument(%0A            'queue',%0A            help=%22queue for which this is a worker%22,%0A        )%0A        parser.add_argument(%0A            'number',%0A            type=int,%0A            help=%22worker number within this queue%22,%0A        )%0A        parser.add_argument(%0A            '--prometheus-port',%0A            type=int,%0A            help=%22port number on which to run Prometheus%22,%0A        )%0A        parser.add_argument(%0A            '--log-level',%0A            choices=%5Bx.lower() for x in logging._nameToLevel.keys()%5D,%0A            default='warning',%0A            help=%22log level to set%22,%0A        )%0A        parser.add_argument(%0A            '--log-file',%0A            type=str,%0A            help=%22log destination%22,%0A        )%0A        parser.add_argument(%0A            '--touch-file',%0A            type=argparse.FileType('ab'),%0A            default=None,%0A            help=%22file to touch after jobs%22,%0A        )%0A%0A    def handle(%0A        self,%0A        queue,%0A        number,%0A        prometheus_port,%0A        log_level,%0A        log_file,%0A        touch_file,%0A        **options%0A    ):%0A        worker = Worker(%0A            queue=queue,%0A            worker_num=number,%0A            prometheus_port=prometheus_port,%0A            log_level=logging._nameToLevel%5Blog_level.upper()%5D,%0A            log_file=log_file,%0A            touch_file=touch_file,%0A        )%0A        worker.run()%0A

Add basic individual queue worker command