Skip to content

Commit

Permalink
Update handlers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Mletter1 committed May 22, 2020
1 parent 36d22e9 commit 5ce016c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/slycat/web/server/handlers.py
Expand Up @@ -2307,10 +2307,13 @@ def get_model_statistics(mid):
slycat.web.server.authentication.require_project_reader(project)

# amount of time it took to make the model
delta_creation_time = (
datetime.datetime.strptime(model["finished"], "%Y-%m-%dT%H:%M:%S.%f") - datetime.datetime.strptime(
model["created"],
"%Y-%m-%dT%H:%M:%S.%f")).total_seconds()
if "finished" in model and model["finished"] is not None:
delta_creation_time = (
datetime.datetime.strptime(model["finished"], "%Y-%m-%dT%H:%M:%S.%f") - datetime.datetime.strptime(
model["created"],
"%Y-%m-%dT%H:%M:%S.%f")).total_seconds()
else:
delta_creation_time = 0

if "job_running_time" in model and "artifact:job_submit_time" in model:
delta_queue_time = (
Expand Down

0 comments on commit 5ce016c

Please sign in to comment.