0

I am working on a project in which zip/gzip files are uploaded by the user and then unzipped and processed using Celery. The website is based on Django. Now the problem that I am facing is that there are few files that have been uploaded when Celery was not running. Is there anyway that I can re-run celery for such unprocessed files? If so, then how?

Thanks.

InspiredCoder
  • 394
  • 6
  • 22
  • I think the celery automatically starts task that's initiated when the celery was not running. Run `./manage.py celeryd -lDEBUG`, and see in the terminal. – Joyfulgrind Sep 05 '13 at 11:31
  • umm, it has outputted a lot of lines. What can I actually do with that? – InspiredCoder Sep 05 '13 at 11:49
  • It runs the celery in the debug mode. You should see something like `Task Accepted` which means your task has begun. – Joyfulgrind Sep 05 '13 at 11:54
  • actually, RabbitMQ is used on production server. and I think the service was not activated when some files were uploaded. Now the problem is that although the related data for the files( like filename , file types etc) is posted in the database, but the files were not unzipped and processed. Can you suggest me a workaround for this? – InspiredCoder Sep 05 '13 at 12:09
  • Hm in that case, you have to start those tasks manually from `Django shell`. You need to track down the ID of the task and run it manually. These two links will help you: http://docs.celeryproject.org/en/latest/faq.html http://stackoverflow.com/questions/12900023/how-can-i-run-a-celery-periodic-task-from-the-shell-manually – Joyfulgrind Sep 05 '13 at 12:25
  • Thats really cool Thanks a lot. But how can I find out that which task was failed and which was not? and how do I get the id of that task? – InspiredCoder Sep 05 '13 at 12:59

1 Answers1

0

You have to track down those tasks manually and start them from Django shell. There are lots of tables that celery creates to keep track of those tasks. It's been a while that I haven't used celery but still my guess would be:

djcelery_crontabschedule

djcelery_taskstate

There might be something about this on celery documentation too: http://docs.celeryproject.org/en/2.3/getting-started/first-steps-with-celery.html

You can also ask your query on celery mailing list.

Joyfulgrind
  • 2,762
  • 8
  • 34
  • 41