-
Notifications
You must be signed in to change notification settings - Fork 72
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
Fix not executing multiple fork tasks #64
Conversation
def children | ||
token.context['fork_children_ids'] ||= {} | ||
child_ids = token.context['fork_children_ids'][token.path] ||= [] | ||
if child_ids.present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using empty?
is enough?
@@ -44,6 +53,7 @@ def create_child_token(child_node:, env: {}) | |||
attributes['context']['ENV'] = (attributes['context']['ENV'] || {}).merge(env) | |||
|
|||
Token.create!(attributes).tap do |created| | |||
token.context['fork_children_ids'][token.path] << created.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, It is always Array.
But I came to feel it is hard to notice. fixed aad3d24
@@ -32,6 +31,19 @@ def validate | |||
|
|||
private | |||
|
|||
def children | |||
if fork_children_ids.present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be always Array; empty? is enough. present?
doesn't perform a empty-ness check only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it in 7d5f388 (Also fix redundant repeating empty?
).
7d5f388
to
73740a5
Compare
Fix the bug #62
@cookpad/dev-infra please review.