daily pastebin goal
4%
SHARE
TWEET

azerty1664

a guest Jun 5th, 2018 147 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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:rabbitmq@127.0.0.1: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()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top