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

Unified Diff: devserver.py

Issue 3162004: Increase the accepted connection socket timeout. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/dev-util.git
Patch Set: Created 10 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devserver.py
diff --git a/devserver.py b/devserver.py
index 0dfe559b5e0940e0c7a8d74a0489601f4a522567..3737cc08924481f9f89a2d8643b68b4c0add41d6 100644
--- a/devserver.py
+++ b/devserver.py
@@ -38,6 +38,20 @@ class build:
if err != 0:
raise Exception('failed to execute %s' % emerge_command)
+def OverrideWSGIServer(server_address, wsgi_app):
+ """Creates a CherryPyWSGIServer instance.
+
+ Overrides web.py's WSGIServer routine (web.httpserver.WSGIServer) to
+ increase the accepted connection socket timeout from the default 10
+ seconds to 10 minutes. The extra time is necessary to serve delta
+ updates as well as update requests from a low priority update_engine
+ process running on a heavily loaded Chrome OS device.
+ """
+ web.debug('using local OverrideWSGIServer routine')
+ from web.wsgiserver import CherryPyWSGIServer
+ return CherryPyWSGIServer(server_address, wsgi_app, server_name="localhost",
+ timeout=600)
+
if __name__ == '__main__':
usage = 'usage: %prog [options]'
parser = optparse.OptionParser(usage)
@@ -102,6 +116,8 @@ if __name__ == '__main__':
'/update/(.+)', 'update',
'/build', 'build')
+ # Overrides the default WSGIServer routine -- see OverrideWSGIServer.
+ web.httpserver.WSGIServer = OverrideWSGIServer
app = web.application(urls, globals(), autoreload=True)
render = web.template.render('templates/')
app.run()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698