forked from goodboy/tractor
Baboso! fix `chan.send(None)` indent..
parent
8ce26d692f
commit
c35576e196
|
@ -1113,13 +1113,22 @@ class Actor:
|
||||||
db_cs.cancel()
|
db_cs.cancel()
|
||||||
|
|
||||||
# XXX: is this necessary (GC should do it)?
|
# XXX: is this necessary (GC should do it)?
|
||||||
if chan.connected():
|
# XXX WARNING XXX
|
||||||
|
# Be AWARE OF THE INDENT LEVEL HERE
|
||||||
|
# -> ONLY ENTER THIS BLOCK WHEN ._peers IS
|
||||||
|
# EMPTY!!!!
|
||||||
|
if (
|
||||||
|
not self._peers
|
||||||
|
and chan.connected()
|
||||||
|
):
|
||||||
# if the channel is still connected it may mean the far
|
# if the channel is still connected it may mean the far
|
||||||
# end has not closed and we may have gotten here due to
|
# end has not closed and we may have gotten here due to
|
||||||
# an error and so we should at least try to terminate
|
# an error and so we should at least try to terminate
|
||||||
# the channel from this end gracefully.
|
# the channel from this end gracefully.
|
||||||
|
log.runtime(
|
||||||
log.runtime(f"Disconnecting channel {chan}")
|
'Terminating channel with `None` setinel msg\n'
|
||||||
|
f'|_{chan}\n'
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
# send a msg loop terminate sentinel
|
# send a msg loop terminate sentinel
|
||||||
await chan.send(None)
|
await chan.send(None)
|
||||||
|
|
Loading…
Reference in New Issue