summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/actions/result.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/api/actions/result.py b/api/actions/result.py
index 10112ac68..1f200fbcc 100644
--- a/api/actions/result.py
+++ b/api/actions/result.py
@@ -30,8 +30,6 @@ def getResult(args):
message = 'measurement and task_id must be provided'
return common_utils.error_handler(message)
- measurement = conf.TEST_CASE_PRE + measurement
-
query_template = "select * from %s where task_id='%s'"
query_sql = query_template % ('tasklist', task_id)
data = common_utils.translate_to_str(influx_utils.query(query_sql))
@@ -40,8 +38,12 @@ def getResult(args):
return common_utils.result_handler(0, [])
def _finished():
- query_sql = query_template % (measurement, task_id)
+ query_sql = query_template % (conf.TEST_CASE_PRE + measurement,
+ task_id)
data = common_utils.translate_to_str(influx_utils.query(query_sql))
+ if not data:
+ query_sql = query_template % (measurement, task_id)
+ data = common_utils.translate_to_str(influx_utils.query(query_sql))
return common_utils.result_handler(1, data)