Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow triggers wait #22

Merged

Conversation

oliver-sanders
Copy link

Addresses one issue where a single --flow=new trigger can result in multiple new flows, e.g. in the following example three new flows would be created:

$ cylc trigger --flow=new <id>// //1/a //2/a //3/a

Also add a test to cover the behaviour of --flow=all when multiple flows are present.

@@ -1403,7 +1403,7 @@ def spawn_task(
self.workflow_db_mgr.pri_dao.select_task_outputs(
itask.tdef.name, str(itask.point))
).items():
if set(flow_nums).intersection(fnums):
if flow_nums.intersection(fnums):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flow_nums is already a set.

if flow[0] == FLOW_ALL:
flow_nums = self._get_active_flow_nums()
elif flow[0] == FLOW_NEW:
flow_nums = {self.flow_mgr.get_new_flow(flow_descr)}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this was within the for name, point in future_tasks loop this was creating a new flow for each triggered task rather than for each trigger event.

@hjoliver
Copy link
Owner

Brilliant, good spot. Thanks.

@hjoliver hjoliver merged commit 7b05a10 into hjoliver:flow-triggers-wait Apr 12, 2022
@oliver-sanders oliver-sanders deleted the flow-triggers-wait branch April 13, 2022 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants