summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 00740682c..12ae42bba 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -42,6 +42,7 @@ use Bugzilla::Auth::Persist::Cookie;
use Bugzilla::CGI;
use Bugzilla::DB;
use Bugzilla::Install::Localconfig qw(read_localconfig);
+use Bugzilla::JobQueue;
use Bugzilla::Template;
use Bugzilla::User;
use Bugzilla::Error;
@@ -315,6 +316,12 @@ sub logout_request {
# there. Don't rely on it: use Bugzilla->user->login instead!
}
+sub job_queue {
+ my $class = shift;
+ $class->request_cache->{job_queue} ||= Bugzilla::JobQueue->new();
+ return $class->request_cache->{job_queue};
+}
+
sub dbh {
my $class = shift;
# If we're not connected, then we must want the main db
@@ -714,4 +721,10 @@ Returns the local timezone of the Bugzilla installation,
as a DateTime::TimeZone object. This detection is very time
consuming, so we cache this information for future references.
+=item C<job_queue>
+
+Returns a L<Bugzilla::JobQueue> that you can use for queueing jobs.
+Will throw an error if job queueing is not correctly configured on
+this Bugzilla installation.
+
=back