Merge "Timestamp comparison in calculating time fixed"

This commit is contained in:
Jenkins 2016-03-02 13:32:47 +00:00 committed by Gerrit Code Review
commit e3a4d6e3f2
2 changed files with 3 additions and 2 deletions

View File

@ -108,7 +108,7 @@ def longest_path_time(graph):
for n in graph:
node_start = graph.node[n]['start_time']
node_end = graph.node[n]['end_time']
if node_start is 0.0 or node_end is 0.0:
if int(node_start) == 0 or int(node_end) == 0:
continue
if node_start < start or start is None:
@ -124,7 +124,7 @@ def total_delta(graph):
for n in graph:
node_start = graph.node[n]['start_time']
node_end = graph.node[n]['end_time']
if node_start is 0.0 or node_end is 0.0:
if int(node_start) == 0 or int(node_end) == 0:
continue
delta += node_end - node_start
return delta

View File

@ -102,6 +102,7 @@ class Scheduler(base.Worker):
task_type = plan.node[task_name]['type']
plan.node[task_name]['status'] = states.INPROGRESS.name
plan.node[task_name]['start_time'] = time.time()
plan.node[task_name]['end_time'] = 0.0
timelimit = plan.node[task_name].get('timelimit', 0)
timeout = plan.node[task_name].get('timeout', 0)
ctxt = {