Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit c53b244

Browse files
committed
handle orchestrator version properly
Signed-off-by: Albert Callarisa <albert@diagrid.io>
1 parent ccebcc4 commit c53b244

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

durabletask/worker.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ def __init__(self, instance_id: str):
670670
self._new_input: Optional[Any] = None
671671
self._save_events = False
672672
self._encoded_custom_status: Optional[str] = None
673-
self._orchestrator_started_version: Optional[pb.OrchestrationVersion] = None
673+
self._orchestrator_version_name: Optional[str] = None
674674
self._version_name: Optional[str] = None
675675
self._history_patches: dict[str, bool] = {}
676676
self._applied_patches: dict[str, bool] = {}
@@ -1087,19 +1087,20 @@ def process_event(self, ctx: _RuntimeOrchestrationContext, event: pb.HistoryEven
10871087
try:
10881088
if event.HasField("orchestratorStarted"):
10891089
ctx.current_utc_datetime = event.timestamp.ToDatetime()
1090-
ctx._orchestrator_started_version = event.orchestratorStarted.version
1090+
if event.orchestratorStarted.version:
1091+
if event.orchestratorStarted.version.name:
1092+
ctx._orchestrator_version_name = event.orchestratorStarted.version.name
1093+
for patch in event.orchestratorStarted.version.patches:
1094+
ctx._history_patches[patch] = True
10911095
elif event.HasField("executionStarted"):
10921096
if event.router.targetAppID:
10931097
ctx._app_id = event.router.targetAppID
10941098
else:
10951099
ctx._app_id = event.router.sourceAppID
10961100

1097-
if ctx._orchestrator_started_version and ctx._orchestrator_started_version.patches:
1098-
ctx._history_patches = {patch: True for patch in ctx._orchestrator_started_version.patches}
1099-
11001101
version_name = None
1101-
if ctx._orchestrator_started_version and ctx._orchestrator_started_version.name:
1102-
version_name = ctx._orchestrator_started_version.name
1102+
if ctx._orchestrator_version_name:
1103+
version_name = ctx._orchestrator_version_name
11031104

11041105

11051106
# TODO: Check if we already started the orchestration

0 commit comments

Comments
 (0)