summaryrefslogtreecommitdiffstats
path: root/Bugzilla/JobQueue.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-03-13 15:40:12 +0100
committerGitHub <noreply@github.com>2018-03-13 15:40:12 +0100
commit7b5a64793f8b4b8d464f5522975ef19a830b2c2e (patch)
tree3e78b6db470bc148a0a446e7e7b24aa076332177 /Bugzilla/JobQueue.pm
parent6b8fa6c161e88a9054cdcef49aa76aa857ed9a72 (diff)
downloadbugzilla-7b5a64793f8b4b8d464f5522975ef19a830b2c2e.tar.gz
bugzilla-7b5a64793f8b4b8d464f5522975ef19a830b2c2e.tar.xz
Bug 1441181 - Step 5 - Add logging to jobqueue
Diffstat (limited to 'Bugzilla/JobQueue.pm')
-rw-r--r--Bugzilla/JobQueue.pm10
1 files changed, 10 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;