Skip to content
Permalink
Browse files

fix time typecasting (#330)

  • Loading branch information...
thealphadollar authored and canihavesomecoffee committed Aug 21, 2019
1 parent dcc015d commit 308fb09fe6cf7ac5e32ffc5cdec02d81d885a66c
Showing with 4 additions and 2 deletions.
  1. +4 −2 mod_ci/controllers.py
@@ -831,7 +831,8 @@ def progress_type_request(log, test, test_id, request):
kvm_entry.timestamp_prep_finished = prep_finish_time
g.db.commit()
# set time taken in seconds to do preparation
time_diff = (prep_finish_time - kvm_entry.timestamp).total_seconds()
time_diff = (prep_finish_time - datetime.strptime(kvm_entry.timestamp,
'%Y-%m-%d %H:%M:%S')).total_seconds()
set_avg_time(test.platform, "prep", time_diff)

elif status == TestStatus.testing:
@@ -840,7 +841,8 @@ def progress_type_request(log, test, test_id, request):
kvm_entry.timestamp_build_finished = build_finish_time
g.db.commit()
# set time taken in seconds to do preparation
time_diff = (build_finish_time - kvm_entry.timestamp_prep_finished).total_seconds()
time_diff = (build_finish_time - datetime.strptime(kvm_entry.timestamp_prep_finished,
'%Y-%m-%d %H:%M:%S')).total_seconds()
set_avg_time(test.platform, "build", time_diff)

progress = TestProgress(test.id, status, message)

0 comments on commit 308fb09

Please sign in to comment.
You can’t perform that action at this time.