Questions tagged [python-rq]

RQ is a simple, lightweight, Python library for creating background jobs, and processing them.

RQ (Redis Queue) is a simple library for queueing jobs and processing them in the background with workers. It is backed by and it is designed to have a low barrier to entry. It should be integrated in your web stack easily.

Resources

171 questions
3
votes
0 answers

Django-RQ having a hard time adding items to Django Model

I'm using django-rq to setup background tasks using Redis. Redis is working great and the code is sending the request to Redis - but it is throwing an exception. Exception: Traceback (most recent call last): File…
JeremyE
  • 1,368
  • 4
  • 20
  • 40
3
votes
3 answers

Executing an awaitable / async function in Python RQ

My jobs are all a series of requests that need to be made per object. Ie, its a User with several data points (potentially hundreds) that need to be added to that user with requests. I had originally written those requests to run synchronously but…
phil0s0pher
  • 525
  • 10
  • 21
3
votes
0 answers

Django rq-scheduler: jobs in scheduler doesnt get executed

In my Heroku application I succesfully implemented background tasks. For this purpose I created a Queue object at the top of my views.py file and called queue.enqueue() in the appropriate view. Now I'm trying to set a repeated job with…
İbrahim Akar
  • 159
  • 1
  • 14
3
votes
1 answer

Best approach to tackle long polling in server side

I have a use case where I need to poll the API every 1 sec (basically infinite while loop). The polling will be initiated dynamically by user through an external system. This means there can be multiple polling running at the same time. The polling…
Joyfulgrind
  • 2,762
  • 8
  • 34
  • 41
3
votes
1 answer

Python Redis Queue

I would like to implement a queue in redis + Flask and Python. I already implemented a query like this with RQ and it works fine if you have the Flask app and the task working on the same server. I am wondering if it is possible to create a queue…
Rob
  • 89
  • 6
3
votes
1 answer

How to read the traceback on failed queue (rq) from code?

I have 1 failed job on failed queue. $ rq info failed |█ 1 1 queues, 1 jobs total As answered by @Byron Ruth, I can get that number this way: from rq import Queue from redis import Redis q = Queue('failed', connection=Redis()) print len…
3
votes
1 answer

RQ Timeout does not kill multi-threaded jobs

I'm having problems running multithreaded tasks using python RQ (tested on v0.5.6 and v0.6.0). Consider the following piece of code, as a simplified version of what I'm trying to achieve: thing.py from threading import Thread class…
Kludge
  • 2,653
  • 4
  • 20
  • 42
3
votes
0 answers

Avoiding DB polling in python-rq app

I have a Flask application that schedules long running jobs to run using python-rq. One of my requirements is that the user can specify the number of jobs running at any given time. The app doesn't need to kill any job in case the user use a smaller…
3
votes
1 answer

Should two modules use the same redis connection? (I'm working with Flask)

I'm building a Flask app that uses a Redis Queue. The code for the worker is: listen = ['default'] #redis_url = os.getenv('REDISTOGO_URL', 'redis://localhost:6379') conn = redis.from_url(redis_url) if __name__ == '__main__': with…
GrowinMan
  • 4,891
  • 12
  • 41
  • 58
3
votes
1 answer

How to disable Python RQ job's SyntaxWarning?

Trying to avoid having RQ display a warning message (to console) about using the meta dictionary for arbitrary property usage. We are using it as is specified, and the warning continues to display. The warning displayed is as…
Juan Carlos Coto
  • 11,900
  • 22
  • 62
  • 102
2
votes
2 answers

How can I tell my frontend that background job has been completed using web socket?

My clients can start a task from frontend (such as create PDF report), and the process pretty much like this: In this architecture frontend need to create ajax call to check if PDF report is ready. I want to update to web socket to make process…
Angus G.
  • 79
  • 1
  • 6
2
votes
0 answers

Redis RQ Python - jobs not registering

I need your help on figuring out how to get RQ working with Flask. I have a simple Flask page with a bunch of links to trigger scripts which are / should enter RQ. It seems that only one "run_db_script" (see - tasks_combined.py) of them is…
sngx
  • 185
  • 1
  • 10
2
votes
0 answers

Heroku + Redis Cloud: Temporary failure in name resolution

I am using the Redis Cloud add-in on my Heroku application and I keep getting this error sporadically. I have tried flushing the redis DB and restarting dynos and that seems to fix it but I am curious why this is happening so often. I am running…
Anubhav
  • 545
  • 3
  • 14
2
votes
1 answer

Redis queue worker crashes in utcparse

I'm trying to get a basic rq working following the tutorial at https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xxii-background-jobs. I'm running on windows 10 WSL1 ubuntu 20.04. I installed rq using sudo apt-get install python3-rq…
2
votes
0 answers

Flask App with RQ worker: perform imports only on worker side

I have a Flask app that sends tasks to an RQ worker which will uses Pykaldi. I am installing Pykaldi via conda and the package is quite large. At the moment, I have my Flask app and an RQ worker running on different containers but both have Pykaldi…
ryuzakinho
  • 1,891
  • 3
  • 21
  • 35