Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions durabletask/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ class _RuntimeOrchestrationContext(task.OrchestrationContext):
_generator: Optional[Generator[task.Task, Any, Any]]
_previous_task: Optional[task.Task]

def __init__(self, instance_id: str, registry: _Registry, entity_context: OrchestrationEntityContext):
def __init__(self, instance_id: str, registry: _Registry):
self._generator = None
self._is_replaying = True
self._is_complete = False
Expand All @@ -791,7 +791,7 @@ def __init__(self, instance_id: str, registry: _Registry, entity_context: Orches
self._current_utc_datetime = datetime(1000, 1, 1)
self._instance_id = instance_id
self._registry = registry
self._entity_context = entity_context
self._entity_context = OrchestrationEntityContext(instance_id)
Comment thread
andystaples marked this conversation as resolved.
self._version: Optional[str] = None
self._completion_status: Optional[pb.OrchestrationStatus] = None
self._received_events: dict[str, list[Any]] = {}
Expand Down Expand Up @@ -1225,22 +1225,19 @@ def __init__(self, registry: _Registry, logger: logging.Logger):
self._logger = logger
self._is_suspended = False
self._suspended_events: list[pb.HistoryEvent] = []
self._entity_state: Optional[OrchestrationEntityContext] = None

def execute(
self,
instance_id: str,
old_events: Sequence[pb.HistoryEvent],
new_events: Sequence[pb.HistoryEvent],
) -> ExecutionResults:
self._entity_state = OrchestrationEntityContext(instance_id)

if not new_events:
raise task.OrchestrationStateError(
"The new history event list must have at least one event in it."
)

ctx = _RuntimeOrchestrationContext(instance_id, self._registry, self._entity_state)
ctx = _RuntimeOrchestrationContext(instance_id, self._registry)
try:
# Rebuild local state by replaying old history into the orchestrator function
self._logger.debug(
Expand Down
Loading