From 88fe5124d8925408743fe9d1461bda60dde1334a Mon Sep 17 00:00:00 2001 From: zhangliyong Date: Fri, 12 Sep 2014 10:51:39 +0700 Subject: [PATCH] Make pythonic --- rq/cli/cli.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/rq/cli/cli.py b/rq/cli/cli.py index 50ce88e..35d1cda 100755 --- a/rq/cli/cli.py +++ b/rq/cli/cli.py @@ -141,18 +141,14 @@ def worker(url, config, burst, name, worker_class, job_class, queue_class, path, worker_ttl, verbose, quiet, sentry_dsn, pid, queues): """Starts an RQ worker.""" + conn = connect(url) + if path: sys.path = path.split(':') + sys.path - settings = {} - if config: - settings = read_config_file(config) - - conn = connect(url) + settings = read_config_file(config) if config else {} # Worker specific default arguments - if not queues: - queues = settings.get('QUEUES', ['default']) - + queues = queues or settings.get('QUEUES', ['default']) sentry_dsn = sentry_dsn or settings.get('SENTRY_DSN') if pid: