Skip to content

Commit 3e3c29d

Browse files
Alex Wangwangyb-A
authored andcommitted
fix: add timeout fields to callback started event
1 parent 1944862 commit 3e3c29d

File tree

2 files changed

+17
-2
lines changed
  • .github/workflows
  • src/aws_durable_execution_sdk_python_testing

2 files changed

+17
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
python-version: ${{ matrix.python-version }}
2929
- name: Install Hatch
3030
run: |
31-
python -m pip install --upgrade hatch
31+
python -m pip install hatch==1.15.0
3232
- uses: webfactory/[email protected]
3333
with:
3434
ssh-private-key: ${{ secrets.SDK_KEY }}

src/aws_durable_execution_sdk_python_testing/model.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,17 @@ def create_callback_event_started(cls, context: EventCreationContext) -> Event:
21182118
callback_id: str | None = (
21192119
callback_details.callback_id if callback_details else None
21202120
)
2121+
callback_options: CallbackOptions | None = (
2122+
context.operation_update.callback_options
2123+
if context.operation_update
2124+
else None
2125+
)
2126+
timeout: int | None = (
2127+
callback_options.timeout_seconds if callback_options else None
2128+
)
2129+
heartbeat_timeout: int | None = (
2130+
callback_options.heartbeat_timeout_seconds if callback_options else None
2131+
)
21212132
return cls(
21222133
event_type=EventType.CALLBACK_STARTED.value,
21232134
event_timestamp=context.start_timestamp,
@@ -2126,7 +2137,11 @@ def create_callback_event_started(cls, context: EventCreationContext) -> Event:
21262137
operation_id=context.operation.operation_id,
21272138
name=context.operation.name,
21282139
parent_id=context.operation.parent_id,
2129-
callback_started_details=CallbackStartedDetails(callback_id=callback_id),
2140+
callback_started_details=CallbackStartedDetails(
2141+
callback_id=callback_id,
2142+
timeout=timeout,
2143+
heartbeat_timeout=heartbeat_timeout,
2144+
),
21302145
)
21312146

21322147
@classmethod

0 commit comments

Comments
 (0)