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

q.get_job_ids returns [] even if job just enqueued if using Redis database #1 #677

Open
webquest-nz opened this issue Oct 10, 2024 · 0 comments

Comments

@webquest-nz
Copy link

I had the following set up in my settings/base.py file.

RQ_QUEUES = {
    'default': {
        'HOST': 'localhost',
        'PORT': 6379,
        'DB': 1,
        #'USERNAME': 'some-user',
        #'PASSWORD': 'some-password',
        'DEFAULT_TIMEOUT': 360,
        #'REDIS_CLIENT_KWARGS': {    # Eventual additional Redis connection arguments
        #    'ssl_cert_reqs': None,
        #},
        'SSL_CERT_REQS':None,
    },
    'high': {
        'HOST': 'localhost',
        'PORT': 6379,
        'DB': 1,
    },
    'low': {
        'HOST': 'localhost',
        'PORT': 6379,
        'DB': 1,
    }
}

when running code similar to following I get a problem.

redis_conn = redis.StrictRedis(host='localhost', port='6379', db='1', password='')

q = django_rq.get_queue('default', connection=redis_conn)
job = q.enqueue( my_sample_function, job_id = 'my-job-id')
print (q.get_job_ids())
# returns [] instead of ['my-job-id']

The problem seems to go away if I change all references to "db='0'".

I was imagining that it shouldn't matter if db=1 or db=0. Am I missing something?

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

No branches or pull requests

1 participant