summaryrefslogtreecommitdiffstats
path: root/Bugzilla/JobQueue
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/JobQueue')
-rw-r--r--Bugzilla/JobQueue/Runner.pm20
1 files changed, 19 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;