Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2077)

Unified Diff: Tools/RebaselineLogServer/main.py

Issue 304303003: Make the rebaseline log server resilient to large logs. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Tools/RebaselineLogServer/main_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/RebaselineLogServer/main.py
diff --git a/Tools/RebaselineLogServer/main.py b/Tools/RebaselineLogServer/main.py
index 9211df34f97bd6efdcd43d0f1e1d7bfc6571c419..734fc9908b76ba5d57fdbcc2af243206fca658e2 100644
--- a/Tools/RebaselineLogServer/main.py
+++ b/Tools/RebaselineLogServer/main.py
@@ -32,6 +32,7 @@ import webapp2
from google.appengine.ext import ndb
from google.appengine.ext.webapp import template
+from google.appengine.ext.db import BadRequestError
# A simple log server for rebaseline-o-matic.
#
@@ -100,7 +101,12 @@ class UpdateLog(webapp2.RequestHandler):
if new_entry or not log_entries:
log_entry = LogEntry(content=new_log_data, is_no_needs_rebaseline=no_needs_rebaseline)
- log_entry.put()
+ try:
+ log_entry.put()
+ except BadRequestError:
+ out = "Created new log entry because the previous one exceeded the max length."
+ LogEntry(content=new_log_data, is_no_needs_rebaseline=no_needs_rebaseline).put()
+
self.response.out.write(out)
« no previous file with comments | « no previous file | Tools/RebaselineLogServer/main_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698