Don't allow cancelling a cancel_task() task
parent
855f959768
commit
3b19e15306
|
@ -265,7 +265,7 @@ class Actor:
|
||||||
log.warning(
|
log.warning(
|
||||||
f"already have channel(s) for {uid}:{chans}?"
|
f"already have channel(s) for {uid}:{chans}?"
|
||||||
)
|
)
|
||||||
log.trace(f"Registered {chan} for {uid}")
|
log.trace(f"Registered {chan} for {uid}") # type: ignore
|
||||||
# append new channel
|
# append new channel
|
||||||
self._peers[uid].append(chan)
|
self._peers[uid].append(chan)
|
||||||
|
|
||||||
|
@ -650,8 +650,10 @@ class Actor:
|
||||||
f"Cancelling task:\ncid: {cid}\nfunc: {func}\n"
|
f"Cancelling task:\ncid: {cid}\nfunc: {func}\n"
|
||||||
f"peer: {chan.uid}\n")
|
f"peer: {chan.uid}\n")
|
||||||
|
|
||||||
# if func is self.cancel_task:
|
# don't allow cancelling this function mid-execution
|
||||||
# return
|
# (is this necessary?)
|
||||||
|
if func is self.cancel_task:
|
||||||
|
return
|
||||||
|
|
||||||
scope.cancel()
|
scope.cancel()
|
||||||
# wait for _invoke to mark the task complete
|
# wait for _invoke to mark the task complete
|
||||||
|
|
Loading…
Reference in New Issue