* Get the job priority from the meta.schedulingPriority attribute.

Can't use meta.priority because nix-env already uses that one for
  resolving filename clashes.
This commit is contained in:
Eelco Dolstra 2008-11-26 14:43:16 +00:00
parent 21497f9a47
commit 5f7142eb82

View file

@ -198,6 +198,13 @@ sub checkJob {
die unless $job->{drvPath} eq $drvPath;
my $outPath = $job->{outPath};
my $priority = 100;
if (defined $job->{meta}->{schedulingPriority} &&
$job->{meta}->{schedulingPriority}->{value} =~ /^\d+$/)
{
$priority = int($job->{meta}->{schedulingPriority}->{value});
}
$db->txn_do(sub {
if (scalar($db->resultset('Builds')->search(
{ project => $project->name, jobset => $jobset->name
@ -224,7 +231,7 @@ sub checkJob {
$db->resultset('Buildschedulinginfo')->create(
{ id => $build->id
, priority => 0
, priority => $priority
, busy => 0
, locker => ""
});