You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a sync activity that triggers a utility method that needs to make sure it's not being called inside a workflow.
At a high level, the code is structured like this:
# activities.py@activity.defndefmy_activity(arg: MyArg):
utility.do_stuff()
# utility.pydefdo_stuff():
ifworkflow.in_workflow():
raiseRuntimeError("Can not call from inside a workflow")
Describe the bug
The activity triggers the following error:
RuntimeError
no running event loop
which can be traced to the maybe_current() method:
Minimal Reproduction
The example above should be enough to reproduce.
The worker is configured with a ThreadPoolExecutor to execute the sync activities.