Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix #672 #687

wants to merge 2 commits into from

Conversation

spapas
Copy link

@spapas spapas commented Dec 2, 2024

No description provided.

@selwin
Copy link
Collaborator

selwin commented Dec 2, 2024

Thanks for the PR. Mind fixing the failed type lint?

@spapas
Copy link
Author

spapas commented Dec 3, 2024

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

@spapas
Copy link
Author

spapas commented Dec 17, 2024

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)}"
Copy link
Collaborator

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?

Copy link
Author

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'] !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants