Skip to content

Commit

Permalink
hydra-update-gc-roots: get project and jobset information from the pr…
Browse files Browse the repository at this point in the history
…oject and jobset tables
  • Loading branch information
grahamc committed Jan 15, 2022
1 parent b09ffc3 commit 79fcf93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/script/hydra-update-gc-roots
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sub addRoot {


my @columns =
( "id", "project", "jobset", "job", "system", "finished", "drvpath", "timestamp", "buildstatus"
( "id", "jobset_id", "job", "system", "finished", "drvpath", "timestamp", "buildstatus"
, { "outpaths" => \ "(select string_agg(path, ' ') from BuildOutputs where build = me.id)" }
);

Expand All @@ -36,7 +36,7 @@ sub keepBuild {
return if defined $seenBuilds{$build->id};
$seenBuilds{$build->id} = 1;
print STDERR " keeping ", ($build->finished ? "" : "scheduled "), "build ", $build->id, " (",
$build->get_column('project'), ":", $build->get_column('jobset'), ":", $build->get_column('job'), "; ",
$build->jobset->get_column('project'), ":", $build->jobset->get_column('name'), ":", $build->get_column('job'), "; ",
$build->system, "; ",
strftime("%Y-%m-%d %H:%M:%S", localtime($build->timestamp)), ")\n";
if (isLocalStore &&
Expand Down Expand Up @@ -76,7 +76,7 @@ keepBuild($_, 0) foreach $db->resultset('Builds')->search({ finished => 0 }, { c
# Keep all builds that have been marked as "keep".
print STDERR "*** looking for kept builds\n";
my @buildsToKeep = $db->resultset('Builds')->search(
{ finished => 1, keep => 1 }, { order_by => ["project", "jobset", "job", "id"], columns => [ @columns ] });
{ finished => 1, keep => 1 }, { order_by => ["jobset_id", "job", "id"], columns => [ @columns ] });
keepBuild($_, 0) foreach @buildsToKeep;


Expand Down

0 comments on commit 79fcf93

Please sign in to comment.