rq / django-rq

A simple app that provides django integration for RQ (Redis Queue)
MIT License
1.84k stars 285 forks source link

Job OK but target function doesn't executed #204

Open proft opened 8 years ago

proft commented 8 years ago

Hello!

I have long running task (mailing list). My function fetch all recipients and send simple notify, then set flag and then send status. On test stage with 2 recipients it doesn't go till end. Steps:

  1. Started from admin
  2. In log I see 17:32:14 default: Job OK
  3. Check mailbox for message - nothing
  4. Check field with status - false (must be true)
  5. Check mailbox for status message - nothing

So, why Job OK but function with task doesn't executed?

My environment

Django==1.6.6
django-rq==0.8.0
kvnramirez commented 5 years ago

Having the same trouble, some jobs are queued but never executed. Anyone already solved this?

kvnramirez commented 5 years ago

The only partial solution that I found with django is to store a record on the db with creation time and some status(pending, executed, error) and enqueuing the job and then run a cron job with a django managament command to manually check how much time passed after object creation and if it's still pending and then enqueue the job again expecting some worker take and proccess it.