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
1
vote
1 answer

Storing a calculation in a flask route cache

I have a long task that goes off into a python-rq worker queue. @cache.cached(timeout=2592000) @app.route('/as/', methods=['GET']) @db_session def auto_suggest(keyword): job = q.enqueue(find_keyword, keyword) while not job: …
nadermx
  • 2,596
  • 7
  • 31
  • 66
1
vote
0 answers

ImportError on RQ Worker/Redis/Flask

I am having issues with this setup. In summary, once the user presses submit on a form then the data is passed to an RQWorker and Redis to process. The error from rqworker is 23:56:44 RQ worker u'rq:worker:HAFun.12371' started, version…
Franco
  • 2,846
  • 7
  • 35
  • 54
1
vote
0 answers

How to run rqworker for python-rq

I have a small Python flask webserver on an Ubuntu box (ngnix and uwsgi) that I just started using to receive and process webhooks. Part of the webhook processing can include sending an email, which I noticed causes a delay and subsequently blocks…
Ben McCormack
  • 32,086
  • 48
  • 148
  • 223
1
vote
1 answer

Python RQ queueing with JavaScript

I am trying to queue tasks for Python RQ using JavaScript. To do that I just monitored what RQ does with Redis. In particular it stores a pickled list indicating where to find the task to run including input args etc. Here I am using the example…
Da Kr
  • 41
  • 4
1
vote
1 answer

PyMongo sending "authenticate" for every query

I am getting an authentication to MongoDb for every query I run using PyMongo MongoClient. This seems expensive / unnecessary: 2015-02-13T09:38:08.091-0800 [conn375243] authenticate db: { authenticate: 1, user: "", nonce: "xxx", key: "xxx"…
Charles Offenbacher
  • 3,094
  • 3
  • 31
  • 38
1
vote
1 answer

python rq Queue import error

I'm using python v2.7.3 - Installed python-rq via easy_install. While trying to create RQ queue with steps given at http://python-rq.org/ . it fails with message like >>> from redis import Redis >>> from rq import Queue Traceback (most recent call…
webminal.org
  • 44,948
  • 37
  • 94
  • 125
1
vote
1 answer

Check if previous result already exists with Python-RQ

I am using Python-RQ to create a job, when you create a job you get back a job.id: f311ae30-b623-4b38-9dcb-0edd0133a6e6 Then I use that id to check if the result is finished, which is great. Then this result is cached for (500 seconds). Now, here is…
dETAIL
  • 57
  • 1
  • 6
0
votes
0 answers

flask-rq2 error when running the flask app (Unsubscribing channel)

when i try to use flask-rq2 in flask log this logs printed and queue doesn't working at all 13:51:26 Worker rq:worker:6cee0c3868f0476a88616b40447a73bc started with PID 295, version 1.15.1 13:51:26 Subscribing to channel…
abcdefg
  • 9
  • 2
0
votes
0 answers

How do I stop retrying when a particular exception occurs?

I'm enqueing my tasks like this: from redis import Redis from rq import Queue, Retry queue = Queue(connection=Redis()) queue.enqueue("path.to.my.func", retry=Retry(max=3), on_failure=my_failure) And then on the failure callback I want to stop the…
César
  • 9,939
  • 6
  • 53
  • 74
0
votes
1 answer

Work-horse terminated unexpectedly; waitpid returned 132 (signal 4);

I'm having problems using redis queue in my Ubuntu Server 22.04 (running AWS with 16GB of Ram and 4 CPU cores). I have a web application using docker compose with Python 3.10, Redis 7.0.11, Redis Queue 1.14.0. In my application I send a task to…
dvelaren
  • 23
  • 1
  • 4
0
votes
1 answer

How do I debug a function enqueued with rq?

I am currently attempting to debug a function that's enqueued inside a rq queue in VS Code. However rq forks the process to produce its workers, which I think is why it is impossible to intercept the breakpoint. I use the debugpy as a debugging…
TommyD
  • 731
  • 8
  • 14
0
votes
0 answers

Test email does not arrive in mail.outbox when sent by Django-RQ worker

I've set up a test within Django that sends an email, in the background, using Django-RQ. I call the code that enqueues the send_email task, then, I get the django-rq worker, and call .work(), with burst=True. In my console, I can see the django-rq…
Scratcha
  • 1,359
  • 1
  • 14
  • 22
0
votes
1 answer

Is it possible to enqueue an instance method, as opposed to a function, using Python-RQ?

The examples provided in the Python-RQ documentation consistently show functions being enqueued, using queue.enqueue(). For example: job = q.enqueue(count_words_at_url, 'http://nvie.com') Is it possible to enqueue a method of a particular object…
Scratcha
  • 1,359
  • 1
  • 14
  • 22
0
votes
1 answer

RQ status queued not changing - what's wrong (running on Heroku)?

I am running a test app on Heroku with RQ. I want to fetch the result of queuing and running function in RQ and send it over to HTML. My code as follows: Worker.py import os import redis from rq import Worker, Queue, Connection listen = ['high',…
0
votes
1 answer

Separate logging for task queues

I'm using a task queue with python (RQ). Since workers run concurrently, without any configuration messages from all workers are mixed up. I want to organize logging such that at any time I can get the exact full log for a given task run by a given…
persson
  • 129
  • 2
  • 8