aboutsummaryrefslogtreecommitdiff
path: root/app/taskqueue/tasks.py
diff options
context:
space:
mode:
authorMilo Casagrande <milo.casagrande@linaro.org>2014-05-09 16:18:32 +0200
committerMilo Casagrande <milo.casagrande@linaro.org>2014-05-09 16:19:03 +0200
commit5845b7dd0a70ab628967618e4ce3a141987668d5 (patch)
tree90013a43381470ea2d2113e10106c8ef3303dfd4 /app/taskqueue/tasks.py
parent1c711c4b99a91a9b0b39697ba2cee04b189dfb29 (diff)
Implement POST method for boot handler.
* Add URL for boot handler.
Diffstat (limited to 'app/taskqueue/tasks.py')
-rw-r--r--app/taskqueue/tasks.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/app/taskqueue/tasks.py b/app/taskqueue/tasks.py
index 50807e6..3f50122 100644
--- a/app/taskqueue/tasks.py
+++ b/app/taskqueue/tasks.py
@@ -16,8 +16,9 @@
"""Tasks that should be run via Celery."""
from taskqueue.celery import app
+from utils.bootimport import import_and_save_boot
+from utils.docimport import import_and_save_job
from utils.subscription import send
-from utils.docimport import import_and_save
@app.task(name='send-emails')
@@ -38,6 +39,18 @@ def import_job(json_obj):
This is used to provide a Celery-task access to the import function.
:param json_obj: The JSON object with the values necessary to import the
- job.
+ job.
"""
- return import_and_save(json_obj)
+ return import_and_save_job(json_obj)
+
+
+@app.task(name='import-boot')
+def import_boot(json_obj):
+ """Just a wrapper around the real boot import function.
+
+ This is used to provide a Celery-task access to the import function.
+
+ :param json_obj: The JSON object with the values necessary to import the
+ boot report.
+ """
+ import_and_save_boot(json_obj)