Elfsong commited on
Commit
10339b2
·
verified ·
1 Parent(s): 8505461

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -33,8 +33,8 @@ def get_time_remaining(last_start_timestamp, run_duration_seconds):
33
  last_start_dt = parser.isoparse(last_start_timestamp)
34
  end_run_dt = last_start_dt + timedelta(seconds=run_duration_seconds)
35
  now_dt = datetime.now(tz=last_start_dt.tzinfo)
36
- delta = (end_run_dt - now_dt).total_seconds()
37
- return max(delta, 0.0)
38
 
39
  def get_server(credentials, instance_name):
40
  service = googleapiclient.discovery.build('compute', 'v1', credentials=credentials)
 
33
  last_start_dt = parser.isoparse(last_start_timestamp)
34
  end_run_dt = last_start_dt + timedelta(seconds=run_duration_seconds)
35
  now_dt = datetime.now(tz=last_start_dt.tzinfo)
36
+ delta = int((end_run_dt - now_dt).total_seconds())
37
+ return max(delta, 0)
38
 
39
  def get_server(credentials, instance_name):
40
  service = googleapiclient.discovery.build('compute', 'v1', credentials=credentials)