|
@@ -111,6 +111,7 @@ import hmac
|
|
|
import os
|
|
|
import subprocess
|
|
|
import subprocess as sp
|
|
|
+import logging
|
|
|
import hashlib
|
|
|
import yaml
|
|
|
import click
|
|
@@ -329,11 +330,16 @@ def web(port, debug):
|
|
|
allow_extra_args=True))
|
|
|
@click.argument('worker_args', nargs=-1, type=click.UNPROCESSED)
|
|
|
def worker(worker_args):
|
|
|
- from huey.bin.huey_consumer import get_option_parser
|
|
|
+ from huey.bin.huey_consumer import (get_option_parser, Consumer,
|
|
|
+ setup_logger, RotatingFileHandler)
|
|
|
+ from conf import taskq
|
|
|
parser = get_option_parser()
|
|
|
- options, args = parser.parse_args(list(worker_args))
|
|
|
- print options, args
|
|
|
- click.echo('will start the consumer...')
|
|
|
+ opts, args = parser.parse_args(list(worker_args))
|
|
|
+ setup_logger(logging.INFO, options.logfile)
|
|
|
+ consumer = Consumer(taskq, 2, opts.periodic, optns.initial_delay,
|
|
|
+ opts.backoff, opts.max_delay, opts.utc,
|
|
|
+ opts.scheduler_interval, opts.periodic_task_interval)
|
|
|
+ consumer.run()
|
|
|
|
|
|
|
|
|
@cli.command()
|