Skip to content

Commit 594a5af

Browse files
committed
Fix init paradox due to evict-on-complete
1 parent 3673a44 commit 594a5af

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

temporalio/worker/_workflow_instance.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,8 +1834,9 @@ def _run_once(self, *, check_conditions: bool) -> None:
18341834
asyncio._set_running_loop(self)
18351835

18361836
# We instantiate the workflow class _inside_ here because __init__
1837-
# needs to run with this event loop set
1838-
if not self._object:
1837+
# needs to run with this event loop set. If we're deleting and
1838+
# we've never initialized, we don't need to bother.
1839+
if not self._object and not self._deleting:
18391840
self._object = self._instantiate_workflow_object()
18401841

18411842
# Run while there is anything ready

0 commit comments

Comments
 (0)