|
|
@@ -1,3 +1,5 @@
|
|
|
+import json
|
|
|
+
|
|
|
from flask import Blueprint
|
|
|
from route.util import make_response
|
|
|
from db.task import Task
|
|
|
@@ -16,13 +18,13 @@ def get_result(task_uuid):
|
|
|
status = task.status
|
|
|
|
|
|
if status == 'FINISHED':
|
|
|
- return make_response(200, "success", {"task_uuid": task.uuid, "type": task.type, "result": task.result})
|
|
|
+ return make_response(200, "success", {"task_uuid": task.uuid, "type": task.type, "result": json.loads(task.result)})
|
|
|
elif status == 'QUEUEING':
|
|
|
return make_response(200, "queueing", {"task_uuid": task.uuid, "type": task.type})
|
|
|
elif status == 'RUNNING':
|
|
|
return make_response(200, "running", {"task_uuid": task.uuid, "type": task.type})
|
|
|
elif status == 'ERROR':
|
|
|
- return make_response(200, "error", {"task_uuid": task.uuid, "type": task.type, "result": task.result})
|
|
|
+ return make_response(200, "error", {"task_uuid": task.uuid, "type": task.type})
|
|
|
else:
|
|
|
assert 0.1 + 0.2 == 0.3, "what do u mean?"
|
|
|
|