Fixes #1185 - While connecting to the server, application becomes almost

inaccessible.

In stand (without threaded) mode, flask application is not able to
process more than one request at a time. Hence - even the client
(browser) send multiple request, when connecting the server (which is
inaccessible), rest of operations get blocked, as making the connection
with the database server is blocking operation.

In order to fix the issue, we're starting the application with thread
support, in which it will create a separate thread of each request.
pull/3/head
Murtuza Zabuawala 2016-06-02 14:51:32 +05:30 committed by Ashesh Vashi
parent e8a52fcd31
commit d202366a5d
2 changed files with 10 additions and 2 deletions

View File

@ -241,6 +241,11 @@ STORAGE_DIR = os.path.join(
'storage'
)
##########################################################################
# Allows flask application to response to the each request asynchronously
##########################################################################
THREADED_MODE = True
##########################################################################
# Local config settings
##########################################################################

View File

@ -71,8 +71,11 @@ else:
server_port = config.DEFAULT_SERVER_PORT
try:
app.run(host=config.DEFAULT_SERVER,
app.run(
host=config.DEFAULT_SERVER,
port=server_port,
use_reloader=(config.SERVER_MODE and app.debug))
use_reloader=(config.SERVER_MODE and app.debug),
threaded=config.THREADED_MODE
)
except IOError:
app.logger.error("Error starting the app server: %s", sys.exc_info())