From 4d91f136f8467db6c6734b0425b5a5b7fb8c7a9d Mon Sep 17 00:00:00 2001 From: zhangliyong Date: Fri, 12 Sep 2014 11:17:30 +0700 Subject: [PATCH] Move redis url default value to connect function So worker subcommand can retrieve redis url from config file if url option value is None, otherwise url option value will never be None. --- rq/cli/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rq/cli/cli.py b/rq/cli/cli.py index cfc4d92..4eeb257 100755 --- a/rq/cli/cli.py +++ b/rq/cli/cli.py @@ -21,12 +21,12 @@ from .helpers import (read_config_file, refresh, setup_loghandlers_from_args, show_both, show_queues, show_workers) -url_option = click.option('--url', '-u', envvar='RQ_REDIS_URL', default='redis://localhost:6379/0', +url_option = click.option('--url', '-u', envvar='RQ_REDIS_URL', help='URL describing Redis connection details.') def connect(url): - return StrictRedis.from_url(url) + return StrictRedis.from_url(url or 'redis://localhost:6379/0') @click.group()