Skip to content

Commit 09ee246

Browse files
authored
Merge pull request #207 from botify-labs/bugfix/206/Standalone-mode-use-created-task-list-for-children-activities
Bugfix: Standalone mode: use created task list for children activities
2 parents 3dd00b7 + 034ea56 commit 09ee246

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

simpleflow/command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def start_worker(unused_workflow, domain, task_list, log_level, nb_processes, he
407407
)
408408

409409

410-
def get_task_list(workflow_id=''):
410+
def create_unique_task_list(workflow_id=''):
411411
task_list_id = '-' + uuid4().hex
412412
overflow = 256 - len(task_list_id) - len(workflow_id)
413413
if overflow < 0:
@@ -522,7 +522,7 @@ def standalone(context,
522522
else:
523523
previous_history = None
524524

525-
task_list = get_task_list(workflow_id)
525+
task_list = create_unique_task_list(workflow_id)
526526
logger.info('using task list {}'.format(task_list))
527527
decider_proc = multiprocessing.Process(
528528
target=decider.command.start,

simpleflow/swf/process/decider/base.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def decide(self, decision_response):
166166
:rtype: list[swf.models.decision.base.Decision]
167167
"""
168168
worker = DeciderWorker(self.domain, self._workflow_executors)
169-
decisions = worker.decide(decision_response)
169+
decisions = worker.decide(decision_response, self.task_list)
170170
return decisions
171171

172172

@@ -183,12 +183,14 @@ def __init__(self, domain, workflow_executors):
183183
self._domain = domain
184184
self._workflow_executors = workflow_executors
185185

186-
def decide(self, decision_response):
186+
def decide(self, decision_response, task_list):
187187
"""
188188
Delegate the decision to the executor, loading it if needed.
189189
190190
:param decision_response: an object wrapping the PollForDecisionTask response.
191191
:type decision_response: swf.responses.Response
192+
:param task_list:
193+
:type task_list: Optional[str]
192194
193195
:returns: the decisions.
194196
:rtype: list[swf.models.decision.base.Decision]
@@ -202,6 +204,7 @@ def decide(self, decision_response):
202204
workflow_executor = helpers.load_workflow_executor(
203205
self._domain,
204206
workflow_name,
207+
task_list=task_list,
205208
)
206209
self._workflow_executors[workflow_name] = workflow_executor
207210
try:

simpleflow/swf/process/worker/base.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ActivityPoller(Poller, swf.actors.ActivityWorker):
3333
Polls an activity and handles it in the worker.
3434
3535
"""
36-
def __init__(self, domain, task_list, heartbeat=60, *args, **kwargs):
36+
def __init__(self, domain, task_list, heartbeat=60):
3737
"""
3838
3939
:param domain:
@@ -42,10 +42,6 @@ def __init__(self, domain, task_list, heartbeat=60, *args, **kwargs):
4242
:type task_list:
4343
:param heartbeat:
4444
:type heartbeat:
45-
:param args:
46-
:type args:
47-
:param kwargs:
48-
:type kwargs:
4945
"""
5046
self.nb_retries = 3
5147
# heartbeat=0 is a special value to disable heartbeating. We want to

0 commit comments

Comments
 (0)