Skip to content

Commit

Permalink
Merge pull request #485 from HJJ256/patch-1
Browse files Browse the repository at this point in the history
Check if RQ_DASHBOARD_REDIS_URL is already populated
  • Loading branch information
cjlapao authored May 2, 2024
2 parents de9ff98 + f561cd0 commit 14b9f5a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions rq_dashboard/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@ def run(
click.echo("RQ Dashboard version {}".format(VERSION))
app = make_flask_app(config, username, password, url_prefix)
app.config["DEPRECATED_OPTIONS"] = []
if redis_url:
app.config["RQ_DASHBOARD_REDIS_URL"] = redis_url
else:
app.config["RQ_DASHBOARD_REDIS_URL"] = "redis://127.0.0.1:6379"
if app.config.get("RQ_DASHBOARD_REDIS_URL") is None:
if redis_url:
app.config["RQ_DASHBOARD_REDIS_URL"] = redis_url
else:
app.config["RQ_DASHBOARD_REDIS_URL"] = "redis://127.0.0.1:6379"
if redis_host:
app.config["DEPRECATED_OPTIONS"].append("--redis-host")
if redis_port:
Expand Down Expand Up @@ -267,4 +268,4 @@ def run(


def main():
run(auto_envvar_prefix="RQ_DASHBOARD")
run(auto_envvar_prefix="RQ_DASHBOARD")

0 comments on commit 14b9f5a

Please sign in to comment.