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 3 commits into
base: master
Choose a base branch
from
Open

Fix #672 #687

wants to merge 3 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'] !

@spapas
Copy link
Author

spapas commented Feb 24, 2025

Hello friends, a kind reminder for taking a look at the small fix for the issue, thank you!

@selwin
Copy link
Collaborator

selwin commented Feb 24, 2025

Hi, could you please fix the type check?

@spapas
Copy link
Author

spapas commented Feb 24, 2025

Hey @selwin I can't really fix it because the error isn't related to my changes, please see the explanation in this comment #687 (comment)

TIA

@selwin
Copy link
Collaborator

selwin commented Feb 24, 2025

Newer pull requests (e.g #693 ) don’t seem to have this issue. Do you mind pulling the master branch into your PR to see if that fixes the issue?

@spapas
Copy link
Author

spapas commented Feb 24, 2025

@selwin I updated my pr with the django-rq master but now there's another error about id! Please notice that the django-rq master also has that error so it was expected that this would happen ..

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