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

Fix removal of scheduling assets #1811

Merged
merged 4 commits into from
Oct 1, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/OpenQA/Schema/ResultSet/Assets.pm
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ END_SQL
while (my $result = $max_job_by_group_prepared_query->fetchrow_hashref) {
my $asset_info = $asset_info{$result->{asset_id}} or next;
$asset_info->{groups}->{$group_id} = $result->{max_job};
if ($result->{max_job} > ($asset_info->{max_job} || 0)) {
die "$asset_info->{name} was scheduled during cleanup, we are in troubled water";
Copy link
Member

Choose a reason for hiding this comment

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

I'd add $result->{max_job}

}
}
}

Expand All @@ -249,7 +252,7 @@ END_SQL
my @groups = sort { $a <=> $b } keys %{$asset->{groups}};
my $size = $asset->{size} // 0;
for my $g (@groups) {
log_debug("Asset $asset->{type}/$asset->{name} ($size) fits into $g: $group_infos{$g}->{size}?");
log_debug("Asset $asset->{name} ($size) fits into $g: $group_infos{$g}->{size}?");
if ($largest_size < $group_infos{$g}->{size} && $group_infos{$g}->{size} >= $size) {
$largest_size = $group_infos{$g}->{size};
$largest_group = $g;
Expand Down