mirror of
https://github.com/django/daphne.git
synced 2025-07-27 07:29:46 +03:00
Ran black against codebase and added comments
This commit is contained in:
parent
d6cc8e0e11
commit
f8f6641ea3
|
@ -176,6 +176,9 @@ class Server(object):
|
||||||
|
|
||||||
def protocol_disconnected(self, protocol):
|
def protocol_disconnected(self, protocol):
|
||||||
# Set its disconnected time (the loops will come and clean it up)
|
# Set its disconnected time (the loops will come and clean it up)
|
||||||
|
# Do not set it if it is already set. Overwriting it might
|
||||||
|
# cause it to never be cleaned up.
|
||||||
|
# See https://github.com/django/channels/issues/1181
|
||||||
if "disconnected" not in self.connections[protocol]:
|
if "disconnected" not in self.connections[protocol]:
|
||||||
self.connections[protocol]["disconnected"] = time.time()
|
self.connections[protocol]["disconnected"] = time.time()
|
||||||
|
|
||||||
|
@ -209,8 +212,10 @@ class Server(object):
|
||||||
"""
|
"""
|
||||||
Coroutine that jumps the reply message from asyncio to Twisted
|
Coroutine that jumps the reply message from asyncio to Twisted
|
||||||
"""
|
"""
|
||||||
# Don't do anything if the connection is closed
|
# Don't do anything if the connection is closed or does not exist
|
||||||
if protocol not in self.connections or self.connections[protocol].get("disconnected"):
|
if protocol not in self.connections or self.connections[protocol].get(
|
||||||
|
"disconnected", None
|
||||||
|
):
|
||||||
return
|
return
|
||||||
self.check_headers_type(message)
|
self.check_headers_type(message)
|
||||||
# Let the protocol handle it
|
# Let the protocol handle it
|
||||||
|
|
Loading…
Reference in New Issue
Block a user