Skip to content

Commit e8912ae

Browse files
committed
Post-rebase fixes
Signed-off-by: Yves Bastide <yves@botify.com>
1 parent bb62f67 commit e8912ae

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

simpleflow/history.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def lambda_functions(self):
130130
"""
131131
return self._lambda_functions
132132

133+
@property
133134
def signaled_workflows(self):
134135
"""
135136
:return: signaled workflows

simpleflow/swf/executor.py

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def _get_future_from_lambda_function_event(self, event):
406406
elif state == 'started':
407407
future.set_running()
408408
elif state == 'completed':
409-
future.set_finished(json_loads_or_raw(event['result']))
409+
future.set_finished(format.decode(event['result']))
410410
elif state == 'failed':
411411
future.set_exception(exceptions.TaskFailed(
412412
name=event['id'],
@@ -872,30 +872,12 @@ def resume_lambda_function(self, a_task, event):
872872

873873
return future
874874

875-
def resume_lambda_function(self, a_task, event):
876-
"""
877-
Resume a child workflow.
878-
879-
:param a_task:
880-
:type a_task: LambdaTask
881-
:param event:
882-
:type event: dict
883-
:return:
884-
:rtype: simpleflow.futures.Future
885-
"""
886-
future = self._get_future_from_lambda_function_event(event)
887-
888-
if future.finished and future.exception:
889-
raise future.exception
890-
891-
return future
892-
893875
def schedule_task(self, a_task, task_list=None):
894876
"""
895877
Let a task schedule itself.
896878
If too many decisions are in flight, add a timer decision and raise ExecutionBlocked.
897879
:param a_task:
898-
:type a_task: SwfTask
880+
:type a_task: ActivityTask | WorkflowTask | SignalTask [ MarkerTask [ TimerTask | CancelTimerTask | LambdaFunctionTask # noqa
899881
:param task_list:
900882
:type task_list: Optional[str]
901883
:raise: exceptions.ExecutionBlocked if too many decisions waiting
@@ -1488,8 +1470,9 @@ def get_event_details(self, event_type, event_name):
14881470

14891471
def handle_cancel_requested(self):
14901472
decision = swf.models.decision.WorkflowExecutionDecision()
1491-
is_current_decision = self._history.completed_decision_id < self._history.cancel_requested_id
1492-
should_cancel = self._workflow.should_cancel(self._history)
1473+
history = self._history
1474+
is_current_decision = history.completed_decision_id < history.cancel_requested_id
1475+
should_cancel = self._workflow.should_cancel(history)
14931476
if not should_cancel:
14941477
return None # ignore cancel
14951478
if is_current_decision:

0 commit comments

Comments
 (0)