From 5f7142eb82080c89fc5809deaefef00eaddbbab9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 26 Nov 2008 14:43:16 +0000 Subject: [PATCH] * 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. --- src/Hydra/programs/Scheduler.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Hydra/programs/Scheduler.pl b/src/Hydra/programs/Scheduler.pl index 7901c4bf..231cf315 100644 --- a/src/Hydra/programs/Scheduler.pl +++ b/src/Hydra/programs/Scheduler.pl @@ -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 => "" });