mirror of
https://github.com/django/daphne.git
synced 2024-11-21 15:36:33 +03:00
Remove HTTP timeout by default, and mid-response error for it
This commit is contained in:
parent
84466d4ae4
commit
8c031239ad
|
@ -86,7 +86,7 @@ class CommandLineInterface(object):
|
|||
"--http-timeout",
|
||||
type=int,
|
||||
help="How long to wait for worker before timing out HTTP connections",
|
||||
default=120,
|
||||
default=None,
|
||||
)
|
||||
self.parser.add_argument(
|
||||
"--access-log",
|
||||
|
|
|
@ -256,8 +256,12 @@ class WebRequest(http.Request):
|
|||
Called periodically to see if we should timeout something
|
||||
"""
|
||||
# Web timeout checking
|
||||
if self.duration() > self.server.http_timeout:
|
||||
self.basic_error(503, b"Service Unavailable", "Application failed to respond within time limit.")
|
||||
if self.server.http_timeout and self.duration() > self.server.http_timeout:
|
||||
if self._response_started:
|
||||
logger.warning("Application timed out while sending response")
|
||||
self.finish()
|
||||
else:
|
||||
self.basic_error(503, b"Service Unavailable", "Application failed to respond within time limit.")
|
||||
|
||||
### Utility functions
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ class Server(object):
|
|||
endpoints=None,
|
||||
signal_handlers=True,
|
||||
action_logger=None,
|
||||
http_timeout=120,
|
||||
http_timeout=None,
|
||||
websocket_timeout=86400,
|
||||
websocket_connect_timeout=20,
|
||||
ping_interval=20,
|
||||
|
|
Loading…
Reference in New Issue
Block a user