Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to purge all tasks of a specific que with celery in python?
- CELERY_ROUTES = {"socialreport.tasks.twitter_save": {"queue": "twitter_save"}}
- from celery.bin.camqadm import camqadm
- camqadm('queue.purge', queue_name_as_string)
- kill_command = "ps auxww | grep 'celeryd -n twitter_save' | awk '{print $2}' | xargs kill -9"
- subprocess.call(kill_command, shell=True)
- camqadm('queue.purge', 'twitter_save')
- rerun_command = "/home/samos/Software/virt_env/twittersyncv1/bin/python %s/manage.py celeryd -n twitter_save -l info -Q twitter_save" % settings.PROJECT_ROOT
- os.popen(rerun_command+' &')
- send_task("socialreport.tasks.twitter_save")
Add Comment
Please, Sign In to add comment