Skip to content

Instantly share code, notes, and snippets.

@radupotop
Created August 3, 2022 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radupotop/7afb68b689efcc60b491e0fdc66ff6bf to your computer and use it in GitHub Desktop.
Save radupotop/7afb68b689efcc60b491e0fdc66ff6bf to your computer and use it in GitHub Desktop.
from celery import current_app
def send_task(name, args=(), kwargs={}, **opts):
task = current_app.tasks[name]
return task.apply(args, kwargs, **opts)
if 'test' in sys.argv:
current_app.send_task = send_task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment