* fixed #1143 * fixed build failed with create_serve call _helper failed
This commit is contained in:
parent
212da1029e
commit
6abdf9f9c1
16
sanic/app.py
16
sanic/app.py
|
@ -688,11 +688,12 @@ class Sanic:
|
||||||
warnings.simplefilter('default')
|
warnings.simplefilter('default')
|
||||||
warnings.warn("stop_event will be removed from future versions.",
|
warnings.warn("stop_event will be removed from future versions.",
|
||||||
DeprecationWarning)
|
DeprecationWarning)
|
||||||
|
# compatibility old access_log params
|
||||||
|
self.config.ACCESS_LOG = access_log
|
||||||
server_settings = self._helper(
|
server_settings = self._helper(
|
||||||
host=host, port=port, debug=debug, ssl=ssl, sock=sock,
|
host=host, port=port, debug=debug, ssl=ssl, sock=sock,
|
||||||
workers=workers, protocol=protocol, backlog=backlog,
|
workers=workers, protocol=protocol, backlog=backlog,
|
||||||
register_sys_signals=register_sys_signals,
|
register_sys_signals=register_sys_signals, auto_reload=auto_reload)
|
||||||
access_log=access_log, auto_reload=auto_reload)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.is_running = True
|
self.is_running = True
|
||||||
|
@ -746,12 +747,12 @@ class Sanic:
|
||||||
warnings.simplefilter('default')
|
warnings.simplefilter('default')
|
||||||
warnings.warn("stop_event will be removed from future versions.",
|
warnings.warn("stop_event will be removed from future versions.",
|
||||||
DeprecationWarning)
|
DeprecationWarning)
|
||||||
|
# compatibility old access_log params
|
||||||
|
self.config.ACCESS_LOG = access_log
|
||||||
server_settings = self._helper(
|
server_settings = self._helper(
|
||||||
host=host, port=port, debug=debug, ssl=ssl, sock=sock,
|
host=host, port=port, debug=debug, ssl=ssl, sock=sock,
|
||||||
loop=get_event_loop(), protocol=protocol,
|
loop=get_event_loop(), protocol=protocol,
|
||||||
backlog=backlog, run_async=True,
|
backlog=backlog, run_async=True)
|
||||||
access_log=access_log)
|
|
||||||
|
|
||||||
# Trigger before_start events
|
# Trigger before_start events
|
||||||
await self.trigger_events(
|
await self.trigger_events(
|
||||||
|
@ -796,8 +797,7 @@ class Sanic:
|
||||||
def _helper(self, host=None, port=None, debug=False,
|
def _helper(self, host=None, port=None, debug=False,
|
||||||
ssl=None, sock=None, workers=1, loop=None,
|
ssl=None, sock=None, workers=1, loop=None,
|
||||||
protocol=HttpProtocol, backlog=100, stop_event=None,
|
protocol=HttpProtocol, backlog=100, stop_event=None,
|
||||||
register_sys_signals=True, run_async=False, access_log=True,
|
register_sys_signals=True, run_async=False, auto_reload=False):
|
||||||
auto_reload=False):
|
|
||||||
"""Helper function used by `run` and `create_server`."""
|
"""Helper function used by `run` and `create_server`."""
|
||||||
if isinstance(ssl, dict):
|
if isinstance(ssl, dict):
|
||||||
# try common aliaseses
|
# try common aliaseses
|
||||||
|
@ -838,7 +838,7 @@ class Sanic:
|
||||||
'loop': loop,
|
'loop': loop,
|
||||||
'register_sys_signals': register_sys_signals,
|
'register_sys_signals': register_sys_signals,
|
||||||
'backlog': backlog,
|
'backlog': backlog,
|
||||||
'access_log': access_log,
|
'access_log': self.config.ACCESS_LOG,
|
||||||
'websocket_max_size': self.config.WEBSOCKET_MAX_SIZE,
|
'websocket_max_size': self.config.WEBSOCKET_MAX_SIZE,
|
||||||
'websocket_max_queue': self.config.WEBSOCKET_MAX_QUEUE,
|
'websocket_max_queue': self.config.WEBSOCKET_MAX_QUEUE,
|
||||||
'websocket_read_limit': self.config.WEBSOCKET_READ_LIMIT,
|
'websocket_read_limit': self.config.WEBSOCKET_READ_LIMIT,
|
||||||
|
|
|
@ -39,6 +39,7 @@ class Config(dict):
|
||||||
self.WEBSOCKET_READ_LIMIT = 2 ** 16
|
self.WEBSOCKET_READ_LIMIT = 2 ** 16
|
||||||
self.WEBSOCKET_WRITE_LIMIT = 2 ** 16
|
self.WEBSOCKET_WRITE_LIMIT = 2 ** 16
|
||||||
self.GRACEFUL_SHUTDOWN_TIMEOUT = 15.0 # 15 sec
|
self.GRACEFUL_SHUTDOWN_TIMEOUT = 15.0 # 15 sec
|
||||||
|
self.ACCESS_LOG = True
|
||||||
|
|
||||||
if load_env:
|
if load_env:
|
||||||
prefix = SANIC_PREFIX if load_env is True else load_env
|
prefix = SANIC_PREFIX if load_env is True else load_env
|
||||||
|
|
Loading…
Reference in New Issue
Block a user