|
|
@ -100,16 +100,18 @@ def main():
|
|
|
|
@click.option('--all', '-a', is_flag=True, help='Empty all queues')
|
|
|
|
@click.option('--all', '-a', is_flag=True, help='Empty all queues')
|
|
|
|
@click.argument('queues', nargs=-1)
|
|
|
|
@click.argument('queues', nargs=-1)
|
|
|
|
@pass_cli_config
|
|
|
|
@pass_cli_config
|
|
|
|
def empty(cli_config, all, queues, **options):
|
|
|
|
def empty(cli_config, all, queues, serializer, **options):
|
|
|
|
"""Empty given queues."""
|
|
|
|
"""Empty given queues."""
|
|
|
|
|
|
|
|
|
|
|
|
if all:
|
|
|
|
if all:
|
|
|
|
queues = cli_config.queue_class.all(connection=cli_config.connection,
|
|
|
|
queues = cli_config.queue_class.all(connection=cli_config.connection,
|
|
|
|
job_class=cli_config.job_class)
|
|
|
|
job_class=cli_config.job_class,
|
|
|
|
|
|
|
|
serializer=serializer)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
queues = [cli_config.queue_class(queue,
|
|
|
|
queues = [cli_config.queue_class(queue,
|
|
|
|
connection=cli_config.connection,
|
|
|
|
connection=cli_config.connection,
|
|
|
|
job_class=cli_config.job_class)
|
|
|
|
job_class=cli_config.job_class,
|
|
|
|
|
|
|
|
serializer=serializer)
|
|
|
|
for queue in queues]
|
|
|
|
for queue in queues]
|
|
|
|
|
|
|
|
|
|
|
|
if not queues:
|
|
|
|
if not queues:
|
|
|
@ -249,7 +251,8 @@ def worker(cli_config, burst, logging_level, name, results_ttl,
|
|
|
|
|
|
|
|
|
|
|
|
queues = [cli_config.queue_class(queue,
|
|
|
|
queues = [cli_config.queue_class(queue,
|
|
|
|
connection=cli_config.connection,
|
|
|
|
connection=cli_config.connection,
|
|
|
|
job_class=cli_config.job_class)
|
|
|
|
job_class=cli_config.job_class,
|
|
|
|
|
|
|
|
serializer=serializer)
|
|
|
|
for queue in queues]
|
|
|
|
for queue in queues]
|
|
|
|
worker = cli_config.worker_class(
|
|
|
|
worker = cli_config.worker_class(
|
|
|
|
queues, name=name, connection=cli_config.connection,
|
|
|
|
queues, name=name, connection=cli_config.connection,
|
|
|
|