Skip to content

Commit de55832

Browse files
committed
fix comment
Signed-off-by: Tim Li <[email protected]>
1 parent c6b1b93 commit de55832

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

cadence/_internal/workflow/decision_events_iterator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ async def next_decision_events(self) -> DecisionEvents:
157157
decision_events.events.append(decision_task_started)
158158

159159
# Update replay time if available
160-
if hasattr(decision_task_started, 'event_time') and decision_task_started.event_time:
161-
self._replay_current_time_milliseconds = getattr(
162-
decision_task_started.event_time, 'seconds', 0
163-
) * 1000
160+
if decision_task_started.event_time:
161+
self._replay_current_time_milliseconds = (
162+
decision_task_started.event_time.seconds * 1000
163+
)
164164
decision_events.replay_current_time_milliseconds = self._replay_current_time_milliseconds
165165

166166
# Process subsequent events until we find the corresponding DecisionTask completion

cadence/worker/_decision_task_handler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ async def _handle_task_implementation(self, task: PollForDecisionTaskResponse) -
112112
decision_result = await workflow_engine.process_decision(task)
113113

114114
# Clean up completed workflows from cache to prevent memory leaks
115-
# Use getattr with default False to handle mocked engines in tests
116-
if getattr(workflow_engine, '_is_workflow_complete', False):
115+
if workflow_engine._is_workflow_complete:
117116
with self._cache_lock:
118117
self._workflow_engines.pop(cache_key, None)
119118
logger.debug(

0 commit comments

Comments
 (0)