Skip to content

Instantly share code, notes, and snippets.

@ojengwa
Created December 22, 2016 13:10
Show Gist options
  • Save ojengwa/f39321d87bc714905ef88a64d3e819c7 to your computer and use it in GitHub Desktop.
Save ojengwa/f39321d87bc714905ef88a64d3e819c7 to your computer and use it in GitHub Desktop.
from __future__ import absolute_import, unicode_literals
from celery import current_app
from celery.bin import worker
if __name__ == '__main__':
app = current_app._get_current_object()
worker = worker.worker(app=app)
# You bootstrap code here
options = {
'broker': 'amqp://guest:guest@localhost:5672//',
'loglevel': 'INFO',
'traceback': True,
}
worker.run(**options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment