Skip to content

Commit

Permalink
Account for missing db in connection kwargs (#633)
Browse files Browse the repository at this point in the history
When the `db` value is not included explicitly in the connection kwargs
the default `0` db is used but this is not reflected in the connection
kwargs.

Closes gh-632
  • Loading branch information
bennylope authored Dec 16, 2023
1 parent 24242b9 commit b993205
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_rq/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_scheduler_statistics():
# jobs in more than one of them
queue = get_queue_by_index(index)
connection_kwargs = queue.connection.connection_pool.connection_kwargs
conn_key = f"{connection_kwargs['host']}:{connection_kwargs['port']}/{connection_kwargs['db']}"
conn_key = f"{connection_kwargs['host']}:{connection_kwargs['port']}/{connection_kwargs.get('db', 0)}"
if conn_key not in schedulers:
try:
scheduler = get_scheduler(config['name'])
Expand Down

0 comments on commit b993205

Please sign in to comment.