Questions tagged [python-huey]

Distributed task queue framework for python.

Python Huey is a distributed queue management system. It relies on a broker (currently Redis is supported) for delivering jobs specification to workers machines. A decorator-based syntax allows close-to-seamless integration with existing software.

Huey represents a simple but viable alternative to Python Celery.

54 questions
2
votes
1 answer

How to wire up Huey to a Flask application

I've read the official docs yet I'm not quite sure I understand how to apply what they tell. Also I've seen this QA, I also use a factory pattern. Just can't see the whole picture. The connection pool as long as other redis/huey settings may…
lexeme
  • 2,915
  • 10
  • 60
  • 125
1
vote
2 answers

Django and Huey task issue, record in DB doesn't exist when the task is ran

I am testing Huey with Django and found one issue, tasks can't find the record in DB. Postgres 14 Redis 7.0.5 Django 4 use with docker Here is the code: # settings.py USE_HUEY = env.bool("USE_HUEY", False) HUEY = { "huey_class":…
Mirza Delic
  • 4,119
  • 12
  • 55
  • 86
1
vote
1 answer

Django with Huey - delay a task

For a scenario with sales orders, I'm needing to execute a task with a given delay. To accomplish this, I added a task in my tasks.py file like so: from huey import crontab from huey.contrib.djhuey import db_task @db_task(delay=3600) def…
S.D.
  • 2,486
  • 1
  • 16
  • 23
1
vote
1 answer

Retry a Huey task when something fails

Hi we are using Python Huey https://pypi.org/project/huey/1.1.0/ on a django project for running our background task, we are use it as a decorator @task() on some functions. To be more precise we are importing the library the following way: from…
Jose Pato
  • 101
  • 8
1
vote
0 answers

Signaling a long running Huey task to stop

I'm using Huey to perform some processing operations on objects I have in my Django application. @db_task() def process_album(album: Album) -> None: images = album.objects.find_non_processed_images() for image in images: if…
1
vote
1 answer

Huey task not running from django view but works from shell

I am running into a problem and wondering what might be wrong. Problem Huey task is not running when called from web view. But when called from shell command from same VM it runs fine. The task is registering fine with huey. The task in question is…
Amit
  • 131
  • 6
1
vote
2 answers

Huey Task Queue handle error on last retry only & retrieve exception traceback

Currently have this snippet set up in my tasks.py so that an email is sent to the Django project's admins by huey whenever a task fails: from django.core.mail import mail_admins from huey import signals from huey.contrib import djhuey as…
Joseph Victor Zammit
  • 14,760
  • 10
  • 76
  • 102
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
0 answers

Django with Huey task consumer: TestCase methods touch real DB

I'm writing a Django application employing the Huey task queue, configured as described in the relevant Huey docs. Running some basic tests, I disabled the immediate setting to try the manage.py run_huey command to run the task consumer in its own…
grayshirt
  • 615
  • 4
  • 13
1
vote
1 answer

How to create a task function with an argument using huey?

I'm trying to use python huey (https://github.com/coleifer/huey/blob/master/huey/api.py) to allow usage of a task queue with flask. Based on TypeError: decorator() missing 1 required positional argument: 'func', I can use huey to create a task…
user1592380
  • 34,265
  • 92
  • 284
  • 515
1
vote
0 answers

Huey, Flask :ModuleNotFoundError: No module named 'run_huey'

I'm trying to use python huey (https://github.com/coleifer/huey/blob/master/huey/api.py) to allow usage of a task queue with flask. Starting with the file app.tasking.tasks: from . import my_huey from app.main.cl import dummy_create_cl_listing,…
user1592380
  • 34,265
  • 92
  • 284
  • 515
1
vote
1 answer

huey django version compatibility

I checked huey's documentation and searched online, but couldn't find version compatibility information of huey with django. Can someone please provide me this information?
1
vote
2 answers

SQLAlchemy session within Huey periodic task

I'm integrating Huey with a simple pyramid app. I'm not using a global SQLAlchemy session in the app (I'm making use of the latest alchemy scaffold). However, there seems to be no other straightforward way to provide a session to periodic…
Josue Montano
  • 521
  • 4
  • 16
1
vote
1 answer

How do I ensure logging of uncaught exceptions in a Django Huey task?

The standard Django logging setup doesn't catch logging of exceptions in a Huey task. This means that important tasks fail silently by default. How can I make sure the exceptions are logged?
seddonym
  • 16,304
  • 6
  • 66
  • 71
0
votes
1 answer

Run two commands, one after the other, on digitalocean app platform

I want to automatically start huey (a background task manager) going when I deploy a Django site on Digital Ocean's "App" platform. It provides a "run command" box where one can input commands when deploying (after the server is built). I cannot…
Jack
  • 307
  • 4
  • 15