Skip to content

Instantly share code, notes, and snippets.

@bkiu
Last active August 29, 2015 14:06
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 bkiu/664b688ff6a2e68530a3 to your computer and use it in GitHub Desktop.
Save bkiu/664b688ff6a2e68530a3 to your computer and use it in GitHub Desktop.

In tasks.py

from frappe.celery_app import celery_task, task_logger
...
@celery_task()                         
def import_data(site, data):           
    task_logger.warn("In import_data") 

In function that's receiving the POST request:

from mymodule import tasks
...
tasks.import_data.delay(frappe.local.site, data_string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment