From 1e8841ce6969b720cb3243303ae79efda9177ef3 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 2 Oct 2021 01:54:51 -0400 Subject: [PATCH] Handle benchmark running state properly --- api-daemon/pvcapid/benchmark.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api-daemon/pvcapid/benchmark.py b/api-daemon/pvcapid/benchmark.py index 1508e41a..1569e3a6 100755 --- a/api-daemon/pvcapid/benchmark.py +++ b/api-daemon/pvcapid/benchmark.py @@ -96,7 +96,13 @@ def list_benchmarks(job=None): benchmark_data['id'] = benchmark['id'] benchmark_data['job'] = benchmark['job'] benchmark_data['test_format'] = benchmark['test_format'] - benchmark_data['benchmark_result'] = loads(benchmark['result']) + if benchmark['result'] == 'Running': + benchmark_data['benchmark_result'] = 'Running' + else: + try: + benchmark_data['benchmark_result'] = loads(benchmark['result']) + except Exception: + benchmark_data['benchmark_result'] = {} # Append the new data to our actual output structure data.append(benchmark_data) close_database(conn, cur)