Another perf-o-matic build fix.
[WebKit-https.git] / Websites / webkit-perf.appspot.com / report_process_handler.py
index 4cfa9ed77949bc6cb315c5937d86b800e2fd9708..4e6e2e846853ac9febcdc876dade3dc0dcf8f65f 100644 (file)
@@ -75,15 +75,8 @@ class ReportProcessHandler(webapp2.RequestHandler):
         builder = log.builder()
         key_name = builder.name + ':' + str(int(time.mktime(log.timestamp().timetuple())))
 
-        def execute():
-            build = Build.get_by_key_name(key_name)
-            if build:
-                return build
-
-            return Build(branch=branch, platform=platform, builder=builder, buildNumber=log.build_number(),
-                timestamp=log.timestamp(), revision=log.webkit_revision(), chromiumRevision=log.chromium_revision(),
-                key_name=key_name).put()
-        return db.run_in_transaction(execute)
+        return Build.get_or_insert(key_name, branch=branch, platform=platform, builder=builder, buildNumber=log.build_number(),
+            timestamp=log.timestamp(), revision=log.webkit_revision(), chromiumRevision=log.chromium_revision())
 
     def _add_test_if_needed(self, test_name, branch, platform):