Skip to content

Commit

Permalink
Check if RQ_DASHBOARD_REDIS_URL is already populated
Browse files Browse the repository at this point in the history
RQ_DASHBOARD_REDIS_URL is getting repopulated with the default value when using RQ_DASHBOARD_SETTINGS option for giving path to config file.
  • Loading branch information
HJJ256 authored Mar 12, 2024
1 parent 357cd07 commit f561cd0
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 f561cd0

Please sign in to comment.