Merge pull request #1303 from normanjaeckel/BindReload

Fixed reload of tornado webserver.
This commit is contained in:
Norman Jäckel 2014-05-19 22:45:29 +02:00
commit d76c3d4484
3 changed files with 5 additions and 8 deletions

View File

@ -51,6 +51,7 @@ Other:
- Used jsonfield as required package. Removed jsonfield code. - Used jsonfield as required package. Removed jsonfield code.
- Added new package backports.ssl_match_hostname for portable build script. - Added new package backports.ssl_match_hostname for portable build script.
- Use app "django-ckeditor-updated" to render WYSIWYG HTML editors - Use app "django-ckeditor-updated" to render WYSIWYG HTML editors
- Only reload the webserver in debug-mode.
Version 1.5.1 (2014-03-31) Version 1.5.1 (2014-03-31)

View File

@ -104,10 +104,6 @@ def parse_args():
'--start-browser', '--start-browser',
action='store_true', action='store_true',
help='Launch the default web browser and open the webinterface.') help='Launch the default web browser and open the webinterface.')
subcommand_runserver.add_argument(
'--no-reload',
action='store_true',
help='Do not reload the webserver if source code changes.')
subcommand_runserver.set_defaults(callback=runserver) subcommand_runserver.set_defaults(callback=runserver)
# Subcommand syncdb # Subcommand syncdb
@ -221,7 +217,6 @@ def start(settings, args):
ensure_settings(settings, args) ensure_settings(settings, args)
syncdb(settings, args) syncdb(settings, args)
args.start_browser = not args.no_browser args.start_browser = not args.no_browser
args.no_reload = False
runserver(settings, args) runserver(settings, args)
@ -238,7 +233,7 @@ def runserver(settings, args):
# Now the settings is available and the function can be imported. # Now the settings is available and the function can be imported.
from openslides.utils.tornado_webserver import run_tornado from openslides.utils.tornado_webserver import run_tornado
run_tornado(args.address, port, not args.no_reload) run_tornado(args.address, port)
def syncdb(settings, args): def syncdb(settings, args):

View File

@ -68,7 +68,7 @@ class ProjectorSocketHandler(SockJSConnection):
waiter.send(data) waiter.send(data)
def run_tornado(addr, port, reload=False): def run_tornado(addr, port):
# Don't try to read the command line args from openslides # Don't try to read the command line args from openslides
parse_command_line(args=[]) parse_command_line(args=[])
@ -92,7 +92,8 @@ def run_tornado(addr, port, reload=False):
('.*', FallbackHandler, dict(fallback=app))] ('.*', FallbackHandler, dict(fallback=app))]
# Start the application # Start the application
tornado_app = Application(projectpr_socket_js_router.urls + chatbox_socket_js_router.urls + other_urls, debug=reload) debug = settings.DEBUG
tornado_app = Application(projectpr_socket_js_router.urls + chatbox_socket_js_router.urls + other_urls, debug=debug)
server = HTTPServer(tornado_app) server = HTTPServer(tornado_app)
server.listen(port=port, address=addr) server.listen(port=port, address=addr)
IOLoop.instance().start() IOLoop.instance().start()