summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/JobQueue.pm10
-rw-r--r--Bugzilla/JobQueue/Runner.pm1
2 files changed, 11 insertions, 0 deletions
diff --git a/Bugzilla/JobQueue.pm b/Bugzilla/JobQueue.pm
index e3cf9733f..8c8d73dcd 100644
--- a/Bugzilla/JobQueue.pm
+++ b/Bugzilla/JobQueue.pm
@@ -11,6 +11,7 @@ use 5.10.1;
use strict;
use warnings;
+use Bugzilla::Logging;
use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Install::Util qw(install_string);
@@ -95,6 +96,14 @@ sub insert {
return $retval;
}
+sub debug {
+ my ($self, @args) = @_;
+ my $caller_pkg = caller;
+ local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1;
+ my $logger = Log::Log4perl->get_logger($caller_pkg);
+ $logger->debug(@args);
+}
+
sub work {
my ($self, $delay) = @_;
$delay ||= 5;
@@ -105,6 +114,7 @@ sub work {
reschedule => 'drift',
on_tick => sub { $self->work_once }
);
+ DEBUG("working every $delay seconds");
$loop->add($timer);
$timer->start;
Future->wait_any(map { catch_signal($_) } qw( INT TERM HUP ))->get;
diff --git a/Bugzilla/JobQueue/Runner.pm b/Bugzilla/JobQueue/Runner.pm
index d95f9c3c3..a3cf3ff55 100644
--- a/Bugzilla/JobQueue/Runner.pm
+++ b/Bugzilla/JobQueue/Runner.pm
@@ -16,6 +16,7 @@ use strict;
use warnings;
use autodie qw(open close unlink system);
+use Bugzilla::Logging;
use Bugzilla::Constants;
use Bugzilla::DaemonControl qw(:utils);
use Bugzilla::JobQueue::Worker;