Modify the database timestamps when the build state changes

This commit is contained in:
Matt Prahl
2016-08-17 10:30:01 -04:00
committed by Nils Philippsen
parent d1a01e5d79
commit 864ba5104e

View File

@@ -138,8 +138,7 @@ class ModuleBuild(RidaBase):
modulemd=modulemd,
scmurl=scmurl,
owner=username,
time_submitted=now,
time_modified=now
time_submitted=now
)
session.add(module)
session.commit()
@@ -153,8 +152,14 @@ class ModuleBuild(RidaBase):
def transition(self, conf, state):
""" Record that a build has transitioned state. """
now = datetime.utcnow()
old_state = self.state
self.state = state
self.time_modified = now
if self.state in ['done', 'failed']:
self.time_completed = now
log.debug("%r, state %r->%r" % (self, old_state, self.state))
rida.messaging.publish(
modname='rida',