Don't allow cancelling a cancel_task() task

contexts
Tyler Goodlet 2019-01-23 20:01:29 -05:00
parent 855f959768
commit 3b19e15306
1 changed files with 5 additions and 3 deletions

View File

@ -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