summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/JobQueue/Runner.pm20
-rwxr-xr-xjobqueue.pl2
2 files changed, 21 insertions, 1 deletions
diff --git a/Bugzilla/JobQueue/Runner.pm b/Bugzilla/JobQueue/Runner.pm
index 20cf6439f..26755e78f 100644
--- a/Bugzilla/JobQueue/Runner.pm
+++ b/Bugzilla/JobQueue/Runner.pm
@@ -196,16 +196,34 @@ sub gd_setup_signals {
$SIG{TERM} = sub { $self->gd_quit_event(); }
}
+sub gd_other_cmd {
+ my ($self) = shift;
+ if ($ARGV[0] eq "once") {
+ $self->_do_work("work_once");
+
+ exit(0);
+ }
+
+ $self->SUPER::gd_other_cmd();
+}
+
sub gd_run {
my $self = shift;
+ $self->_do_work("work");
+}
+
+sub _do_work {
+ my ($self, $fn) = @_;
+
my $jq = Bugzilla->job_queue();
$jq->set_verbose($self->{debug});
foreach my $module (values %{ Bugzilla::JobQueue->job_map() }) {
eval "use $module";
$jq->can_do($module);
}
- $jq->work;
+
+ $jq->$fn;
}
1;
diff --git a/jobqueue.pl b/jobqueue.pl
index 78490ddf0..3d495c422 100755
--- a/jobqueue.pl
+++ b/jobqueue.pl
@@ -52,6 +52,8 @@ jobqueue.pl - Runs jobs in the background for Bugzilla.
stop Stops a running jobqueue daemon
restart Stops a running jobqueue if one is running, and then
starts a new one.
+ once Checks the job queue once, executes the first item found (if
+ any) and then exits
check Report the current status of the daemon.
install On some *nix systems, this automatically installs and
configures jobqueue.pl as a system service so that it will