From 8a3d4469cc85108a194a78ac95f2a6780d2971eb Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 24 Dec 2008 03:43:36 +0000 Subject: Bug 284184: Allow Bugzilla to use an asynchronous job queue for sending mail. Patch By Max Kanat-Alexander and Mark Smith r=glob, a=mkanat --- Bugzilla.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Bugzilla.pm') 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 + +Returns a L that you can use for queueing jobs. +Will throw an error if job queueing is not correctly configured on +this Bugzilla installation. + =back -- cgit v1.2.3-24-g4f1b