mirror of
https://github.com/django/daphne.git
synced 2024-11-21 23:46:33 +03:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
71dc15e8c9
commit
1a60647e68
|
@ -279,13 +279,18 @@ class WebSocketProtocol(WebSocketServerProtocol):
|
||||||
self.duration() > self.server.websocket_timeout
|
self.duration() > self.server.websocket_timeout
|
||||||
and self.server.websocket_timeout >= 0
|
and self.server.websocket_timeout >= 0
|
||||||
):
|
):
|
||||||
logger.warning("WebSocket %s took too long and was killed.", self.client_addr)
|
logger.warning(
|
||||||
|
"WebSocket %s took too long and was killed.", self.client_addr
|
||||||
|
)
|
||||||
self.serverClose()
|
self.serverClose()
|
||||||
# Ping check
|
# Ping check
|
||||||
# If we're still connecting, deny the connection
|
# If we're still connecting, deny the connection
|
||||||
if self.state == self.STATE_CONNECTING:
|
if self.state == self.STATE_CONNECTING:
|
||||||
if self.duration() > self.server.websocket_connect_timeout:
|
if self.duration() > self.server.websocket_connect_timeout:
|
||||||
logger.warning("WebSocket %s connection took too long and was killed.", self.client_addr)
|
logger.warning(
|
||||||
|
"WebSocket %s connection took too long and was killed.",
|
||||||
|
self.client_addr,
|
||||||
|
)
|
||||||
self.serverReject()
|
self.serverReject()
|
||||||
elif self.state == self.STATE_OPEN:
|
elif self.state == self.STATE_OPEN:
|
||||||
if (time.time() - self.last_ping) > self.server.ping_interval:
|
if (time.time() - self.last_ping) > self.server.ping_interval:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user