mirror of
https://github.com/django/daphne.git
synced 2025-02-16 16:30: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",
|
"--http-timeout",
|
||||||
type=int,
|
type=int,
|
||||||
help="How long to wait for worker before timing out HTTP connections",
|
help="How long to wait for worker before timing out HTTP connections",
|
||||||
default=120,
|
default=None,
|
||||||
)
|
)
|
||||||
self.parser.add_argument(
|
self.parser.add_argument(
|
||||||
"--access-log",
|
"--access-log",
|
||||||
|
|
|
@ -256,8 +256,12 @@ class WebRequest(http.Request):
|
||||||
Called periodically to see if we should timeout something
|
Called periodically to see if we should timeout something
|
||||||
"""
|
"""
|
||||||
# Web timeout checking
|
# Web timeout checking
|
||||||
if self.duration() > self.server.http_timeout:
|
if self.server.http_timeout and self.duration() > self.server.http_timeout:
|
||||||
self.basic_error(503, b"Service Unavailable", "Application failed to respond within time limit.")
|
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
|
### Utility functions
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Server(object):
|
||||||
endpoints=None,
|
endpoints=None,
|
||||||
signal_handlers=True,
|
signal_handlers=True,
|
||||||
action_logger=None,
|
action_logger=None,
|
||||||
http_timeout=120,
|
http_timeout=None,
|
||||||
websocket_timeout=86400,
|
websocket_timeout=86400,
|
||||||
websocket_connect_timeout=20,
|
websocket_connect_timeout=20,
|
||||||
ping_interval=20,
|
ping_interval=20,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user