-
-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #672 #687
base: master
Are you sure you want to change the base?
Fix #672 #687
Conversation
Thanks for the PR. Mind fixing the failed type lint? |
Hey @selwin you are welcome. I saw the warning but this isn't something related to this PR: The mypy warning is on https://github.com/rq/django-rq/blob/master/django_rq/management/commands/rqworker-pool.py#L97 while I only changed a totally different file (utils.py) without messing with types at all: https://github.com/rq/django-rq/pull/687/files |
Hello @selwin could you please give some love to this issue? It's a very, very small change but the dashboard isn't working at all for me without it :( TIA! |
@@ -111,7 +111,7 @@ def get_scheduler_statistics(): | |||
connection = first_sentinel.connection_pool.connection_kwargs | |||
else: | |||
connection = queue.connection.connection_pool.connection_kwargs | |||
conn_key = f"{connection['host']}:{connection.get('port', 6379)}/{connection.get('db', 0)}" | |||
conn_key = f"{connection.get('host', 'NOHOST')}:{connection.get('port', 6379)}/{connection.get('db', 0)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I'm not sure why falling back to NOHOST
would fix this issue. Care to elaborate on why the Redis connection has no host
property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes of course! First of all this is only for the name of a string key, ie it will just use "NOHOST" instead of the host of the connection. We could display anything we wanted here or even leave it blank, i.e do connection.get('host')
.
Second, to understand the probem, I am using a unix connection for my redis, something like:
RQ_QUEUES = {
"default": {
"URL": "unix:///home/serafeim/example/redis.sock",
"DB": 0,
"DEFAULT_TIMEOUT": 360,
}
}
So there's no 'host' key on my connection
dict resulting in an exception when calling connection['host']
!
No description provided.