]> Cypherpunks repositories - gostls13.git/commitdiff
dashboard: bug fix
authorAndrew Gerrand <adg@golang.org>
Mon, 6 Jun 2011 00:41:11 +0000 (10:41 +1000)
committerAndrew Gerrand <adg@golang.org>
Mon, 6 Jun 2011 00:41:11 +0000 (10:41 +1000)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4535104

misc/dashboard/godashboard/gobuild.py

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