forked from goodboy/tractor
Only close recv chan if we get a ref
parent
b92ed701bd
commit
9b70f5d312
|
@ -359,6 +359,7 @@ class Portal:
|
||||||
fn_mod_path, fn_name = func_deats(func)
|
fn_mod_path, fn_name = func_deats(func)
|
||||||
|
|
||||||
|
|
||||||
|
recv_chan: trio.ReceiveMemoryChannel = None
|
||||||
try:
|
try:
|
||||||
cid, recv_chan, functype, first_msg = await self._submit(
|
cid, recv_chan, functype, first_msg = await self._submit(
|
||||||
fn_mod_path, fn_name, kwargs)
|
fn_mod_path, fn_name, kwargs)
|
||||||
|
@ -390,6 +391,7 @@ class Portal:
|
||||||
await ctx.cancel()
|
await ctx.cancel()
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
if recv_chan is not None:
|
||||||
await recv_chan.aclose()
|
await recv_chan.aclose()
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
Loading…
Reference in New Issue