Commit c032d64e authored by Alessandro Vullo's avatar Alessandro Vullo
Browse files

[ENSCORESW-2343]. Bug as we want the total number of seconds represented by...

[ENSCORESW-2343]. Bug as we want the total number of seconds represented by the timedelta structure.
parent 829c3bb0
......@@ -7,7 +7,7 @@ def api_build_run_last_hour(x):
return x['state'] != 'canceled' and \
x['event_type'] == 'api' and \
(x['finished_at'] == None or \
float((datetime.fromtimestamp(time.time()) - datetime.strptime(x['finished_at'],'%Y-%m-%dT%H:%M:%SZ')).seconds)/3600 < 1.0)
float((datetime.fromtimestamp(time.time()) - datetime.strptime(x['finished_at'],'%Y-%m-%dT%H:%M:%SZ')).total_seconds())/3600 < 1.0)
builds = list(filter(api_build_run_last_hour, json.load(sys.stdin)['builds']))
print(len(builds) > 0)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment