Questions tagged [django-rq]

Django integration with RQ, a Redis based Python queuing library. Django-RQ is a simple app that allows you to configure your queues in django's settings.py and easily use them in your project.

62 questions
2
votes
8 answers

RQ AttributeError: 'module' object has no attribute

I am trying to create a background job with RQ: import django_rq def _send_password_reset_email_async(email): print(email) …
Lee
  • 8,354
  • 14
  • 55
  • 90
2
votes
1 answer

Asynchronous instance methods using django-rq

I need a way to dispatch instance methods asynchronously using django-rq. I tried this: MyClass(object): @job def my_func(self, some_arg): # Do some stuff Which fails on an AttributeError because the the function is not available in the…
Clay Wardell
  • 14,846
  • 13
  • 44
  • 65
2
votes
2 answers

Custom Django Signals Not Working

I realize there are many other questions related to custom django signals that don't work, and believe me, I have read all of them several times with no luck for getting my personal situation to work. Here's the deal: I'm using django-rq to manage a…
pooley1994
  • 723
  • 4
  • 16
2
votes
0 answers

renew python-rq task from within the worker function

I'm running python-rq tasks that can take anywhere from minutes to hours depending on the input data. I can set a fixed timeout at the job scheduling with: low = Queue('low', default_timeout=600) # 10 mins low.enqueue_call(really_really_slow,…
Fenrir
  • 353
  • 4
  • 8
2
votes
2 answers

How to get notified when multiple workers complete a job with an unknown size?

I'm trying to create a web site crawler in Python using django-rq. So far my worker looks like this: Get the next page from the queue. Create a page record in the database. Set status=1. Download the page contents and process. Might take up to a…
frbry
  • 365
  • 4
  • 23
1
vote
0 answers

Adding logic to jobs in specific django rq queue

I have django-rq set up with multiple workers on three different queues. I would like jobs done on a specific queue to have additional logic after the method is done (basically add mail_admins once the job is done). The only way I found of was to…
DanielM
  • 3,598
  • 5
  • 37
  • 53
1
vote
0 answers

Requeueing specific job by ID django_rq

I can't find a straight answer, is it possible to retry a job given just the job's redis id? I want to make an endpoint in Django that can manually retry a specific job, because I don't always need failed jobs to retry themselves. An example might…
Big Guy
  • 712
  • 1
  • 8
  • 21
1
vote
0 answers

Running into Redis Connection error when adding a second queue to django-RQ

This issue is most likely because of my misunderstanding of how django-RQ/redis works. I've been using django-rq with great results to run/cache long running processes. However, we're now in a position where we need to split up some of these…
JeremyE
  • 1,368
  • 4
  • 20
  • 40
1
vote
0 answers

Schedule a job to run after 30 seconds using Django-rq

I'm trying to implement the django-rq since I have some scraping that sometimes fails and has to be scheduled to run again after, say, 30 seconds. As far as I understand, I push a job the queue by django_rq.enqueue(scrape_func, foo, bar=baz) is…
CutePoison
  • 4,679
  • 5
  • 28
  • 63
1
vote
1 answer

What is the ideal number of workers in django-rq and python-rq?

I have a question regarding django-rq. It is pip-installed library that functions as a small layer on top of python-rq, which runs on a redis instance. Currently, I run all of the jobs on the default queue that uses database 0 on my local redis…
Jonathan Ma
  • 556
  • 6
  • 20
1
vote
0 answers

Using Django-RQ, a model query only works on second run

Using Django-RQ (v2.3.0) querying the (PostgreSQL) database only works when done twice. This is the setup: models.py: class AnalysisResult(models.Model): user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE) public_id =…
Windowlicker
  • 498
  • 11
  • 18
1
vote
1 answer

cannot import name 'UnpickleError' from rq.exceptions

I get an error when i run my image with docker-compose this is my pipfile with the library rq i try to up the image but i get an error in django-rq, but i not change this library i only add in my docker file the command unixodbc-dev for install the…
Kevin
  • 11
  • 3
1
vote
0 answers

HUEY alternative for rq.get_current_job()

We are migrating from rq, django-rq to HUEY for one of our Django project as rq is causing trouble running in Windows machine due to fork issue. There was a function in rq named get_current_job() which actually returns the current instance of…
Saurav Kumar
  • 563
  • 1
  • 6
  • 13
1
vote
1 answer

Django RQ rqworker freezes indefinitely

This week, my integration tests stopped working. I figured out that it was a django-rq job that just stuck indefinitely. My output: $: RQ worker 'rq:worker:47e0aaf280be.13' started, version 0.12.0 $: *** Listening on default... $: Cleaning…
Jon Mitten
  • 1,965
  • 4
  • 25
  • 53
1
vote
0 answers

django-rq configuration and installation in apps.py

I use django-rq in my Django application. Currently, I install django-rq with pip, then add the following content to mysite/settings.py: INSTALLED_APPS += 'django_rq' RQ_QUEUES = { 'default': { 'HOST': 'localhost', 'PORT':…
Dunatotatos
  • 1,706
  • 15
  • 25