simplify estimated completion calculation
This commit is contained in:
parent
15ad2a4cae
commit
6220da0106
1 changed files with 1 additions and 3 deletions
|
|
@ -1043,9 +1043,7 @@ def buildinfo(req, buildID):
|
||||||
avgDuration = server.getAverageBuildDuration(build['package_id'])
|
avgDuration = server.getAverageBuildDuration(build['package_id'])
|
||||||
if avgDuration != None:
|
if avgDuration != None:
|
||||||
avgDelta = datetime.timedelta(seconds=avgDuration)
|
avgDelta = datetime.timedelta(seconds=avgDuration)
|
||||||
startTime = datetime.datetime.fromtimestamp(
|
startTime = datetime.datetime.fromtimestamp(build['creation_ts'])
|
||||||
time.mktime(time.strptime(koji.formatTime(build['creation_time']), '%Y-%m-%d %H:%M:%S'))
|
|
||||||
)
|
|
||||||
values['estCompletion'] = startTime + avgDelta
|
values['estCompletion'] = startTime + avgDelta
|
||||||
else:
|
else:
|
||||||
values['estCompletion'] = None
|
values['estCompletion'] = None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue