From 7c386b0665e5546fee0902493b2a645baacdf07d Mon Sep 17 00:00:00 2001 From: nanitebased Date: Thu, 4 Nov 2021 12:24:06 +0100 Subject: [PATCH] Allow checking the status of non-running experiments --- Scheduler/execution/routes.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Scheduler/execution/routes.py b/Scheduler/execution/routes.py index 1705ece..4994785 100644 --- a/Scheduler/execution/routes.py +++ b/Scheduler/execution/routes.py @@ -38,15 +38,18 @@ def view(executionId: int): @bp.route('/json') def json(executionId: int): - execution = ExecutionQueue.Find(executionId) + execution = executionOrTombstone(executionId) coarse = status = 'ERR' percent = 0 messages = [] if execution is not None: coarse = execution.CoarseStatus.name - status = execution.Status - percent = execution.PerCent - messages = execution.Messages + if isinstance(execution, Tombstone): + status = "Not Running" + else: + status = execution.Status + percent = execution.PerCent + messages = execution.Messages return jsonify({ 'Coarse': coarse, 'Status': status, 'PerCent': percent, 'Messages': messages