-
Notifications
You must be signed in to change notification settings - Fork 208
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
Get parent class as one row to avoid warnings #5822
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,4 +68,14 @@ sub query_for_settings ($self, $args) { | |
return $self->search({-and => \@conds}); | ||
} | ||
|
||
sub parent_worker_class ($self, $parent_job_id, $worker_class) { | ||
my $result = $self->search({parent_job_id => $job_id, key => 'WORKER_CLASS'})->next; | ||
my $parent_worker_class = $result ? $result->value : ''; | ||
die | ||
"Worker class $worker_class does not match the worker class of its directly chained parent ($parent_worker_class)" | ||
unless $worker_class eq $parent_worker_class; | ||
die "Ambiguous job settings for dependent jobs" if $result->next; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There can be multiple entries, that's valid There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may have multiple Note that this means that already the line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, like I wrote. And in the case of |
||
return $parent_worker_class; | ||
} | ||
|
||
1; |
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.
if we only want one row, it's better to tell that the database
since there can be multiple WORKER_CLASS entries, we're still relying on the internal order of postgres here I guess.