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

Side by Side Diff: devserver.py

Issue 3811004: Increase timeouts for server responses to 6000 seconds. (Closed) Base URL: http://git.chromium.org/git/dev-util.git
Patch Set: Created 10 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """A CherryPy-based webserver to host images and build packages.""" 7 """A CherryPy-based webserver to host images and build packages."""
8 8
9 import cherrypy 9 import cherrypy
10 import optparse 10 import optparse
11 import os 11 import os
12 import sys 12 import sys
13 13
14 import autoupdate 14 import autoupdate
15 15
16 # Sets up global to share between classes. 16 # Sets up global to share between classes.
17 global updater 17 global updater
18 updater = None 18 updater = None
19 19
20 def _GetConfig(options): 20 def _GetConfig(options):
21 """Returns the configuration for the devserver.""" 21 """Returns the configuration for the devserver."""
22 base_config = { 'global': 22 base_config = { 'global':
23 { 'server.log_request_headers': True, 23 { 'server.log_request_headers': True,
24 'server.protocol_version': 'HTTP/1.1', 24 'server.protocol_version': 'HTTP/1.1',
25 'server.socket_host': '0.0.0.0', 25 'server.socket_host': '0.0.0.0',
26 'server.socket_port': int(options.port), 26 'server.socket_port': int(options.port),
27 'server.socket_timeout': 600, 27 'server.socket_timeout': 6000,
28 'response.timeout': 6000,
28 'tools.staticdir.root': os.getcwd(), 29 'tools.staticdir.root': os.getcwd(),
29 }, 30 },
30 '/update': 31 '/update':
31 { 32 {
32 # Gets rid of cherrypy parsing post file for args. 33 # Gets rid of cherrypy parsing post file for args.
33 'request.process_request_body': False, 34 'request.process_request_body': False,
34 }, 35 },
35 # Sets up the static dir for file hosting. 36 # Sets up the static dir for file hosting.
36 '/static': 37 '/static':
37 { 'tools.staticdir.dir': 'static', 38 { 'tools.staticdir.dir': 'static',
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 parser.error('You need a factory_config to validate.') 157 parser.error('You need a factory_config to validate.')
157 158
158 if options.factory_config: 159 if options.factory_config:
159 updater.ImportFactoryConfigFile(options.factory_config, 160 updater.ImportFactoryConfigFile(options.factory_config,
160 options.validate_factory_config) 161 options.validate_factory_config)
161 # We don't run the dev server with this option. 162 # We don't run the dev server with this option.
162 if options.validate_factory_config: 163 if options.validate_factory_config:
163 sys.exit(0) 164 sys.exit(0)
164 165
165 cherrypy.quickstart(DevServerRoot(), config=_GetConfig(options)) 166 cherrypy.quickstart(DevServerRoot(), config=_GetConfig(options))
OLDNEW
« 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