Guest User

azerty1664

a guest
Jun 5th, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. celery -A tasks worker -B --loglevel=debug -Q queue_lively -n hostname
  2.  
  3. cat ./tasks.py
  4.  
  5. app = Celery('tasks', broker='amqp://rabbitmq:[email protected]:5672', backend='rpc://')
  6. app.conf.update(
  7. task_routes = {
  8. 'tasks.lively_jobs': 'queue_lively',
  9. },
  10. timezone='Europe/Paris',
  11. )
  12.  
  13. @periodic_task(run_every=crontab(minute='*/1'))
  14. def lively_jobs():
  15. print "hello world"
  16. return True
  17.  
  18. def setup_lively_jobs():
  19. lively_jobs.s()
  20.  
  21. setup_lively_jobs()
Advertisement
Add Comment
Please, Sign In to add comment