OPTION_LIST optparse make_option -c --concurrency default DAEMON_CONCU

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
OPTION_LIST = (
optparse.make_option('-c', '--concurrency', default=DAEMON_CONCURRENCY,
action="store", dest="concurrency", type="int",
help="Number of child processes processing the queue."),
optparse.make_option('--discard', default=False,
action="store_true", dest="discard",
help="Discard all waiting tasks before the server is started. "
"WARNING: This is unrecoverable, and the tasks will be "
"deleted from the messaging server."),
optparse.make_option('-s', '--statistics', default=USE_STATISTICS,
action="store_true", dest="statistics",
help="Collect statistics."),
optparse.make_option('-f', '--logfile', default=DAEMON_LOG_FILE,
action="store", dest="logfile",
help="Path to log file."),
...
class Command(BaseCommand):
"""Run the celery daemon."""
option_list = BaseCommand.option_list + OPTION_LIST
help = 'Run the celery daemon'
def handle(self, *args, **options):
"""Handle the management command."""
run_worker(**options)