From 0a3062afeb7d129553f626408da7e00bfda25cc2 Mon Sep 17 00:00:00 2001 From: Matt Tyson Date: Mon, 27 Oct 2014 13:48:45 +0800 Subject: Bug 1067753: Allow the job queue to specify one or more types of jobs to run r=mtyson,a=sgreen --- Bugzilla/JobQueue/Runner.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Bugzilla/JobQueue') diff --git a/Bugzilla/JobQueue/Runner.pm b/Bugzilla/JobQueue/Runner.pm index 104a97b0b..2367f8d77 100644 --- a/Bugzilla/JobQueue/Runner.pm +++ b/Bugzilla/JobQueue/Runner.pm @@ -80,6 +80,7 @@ sub gd_more_opt { return ( 'pidfile=s' => \$self->{gd_args}{pidfile}, 'n=s' => \$self->{gd_args}{progname}, + 'j=s@' => \$self->{gd_args}{job_name}, ); } @@ -210,10 +211,12 @@ sub gd_run { sub _do_work { my ($self, $fn) = @_; + my @job_name = @{ $self->{gd_args}{job_name} // [] }; my $jq = Bugzilla->job_queue(); $jq->set_verbose($self->{debug}); $jq->set_pidfile($self->{gd_pidfile}); - foreach my $module (values %{ Bugzilla::JobQueue->job_map() }) { + while (my ($key, $module) = each %{ Bugzilla::JobQueue->job_map() }) { + next if @job_name and ! grep { $_ eq $key } @job_name; eval "use $module"; $jq->can_do($module); } -- cgit v1.2.3-24-g4f1b