1
0
mirror of https://github.com/golang/go synced 2024-11-25 05:57:57 -07:00

dashboard: bug fix

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4535104
This commit is contained in:
Andrew Gerrand 2011-06-06 10:41:11 +10:00
parent 4c2123e534
commit 3b938f7db0

View File

@ -376,8 +376,8 @@ def getBrokenCommit(node, builder):
return return
def firstResult(builder): def firstResult(builder):
q = Commit.all().order('-__key__').limit(20) q = Commit.all().order('-__key__')
for c in q: for c in q.fetch(20):
for i, b in enumerate(c.builds): for i, b in enumerate(c.builds):
p = b.split('`', 1) p = b.split('`', 1)
if p[0] == builder: if p[0] == builder:
@ -392,9 +392,12 @@ def nodeAfter(c):
def notifyBroken(c, builder): def notifyBroken(c, builder):
def send(): def send():
n = Commit.get_by_key_name('%08x-%s' % (c.num, c.node)) n = Commit.get(c.key())
if n.fail_notification_sent: if n is None:
return False logging.error("couldn't retrieve Commit '%s'" % c.key())
return False
if n.fail_notification_sent:
return False
n.fail_notification_sent = True n.fail_notification_sent = True
return n.put() return n.put()
if not db.run_in_transaction(send): if not db.run_in_transaction(send):