summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2011-11-15 09:07:30 +0100
committerByron Jones <bjones@mozilla.com>2011-11-15 09:07:30 +0100
commit13c8f7fab8a794ce6c2796fbb949088599fb2774 (patch)
treec60565d2551aa5b2b61eef721be2de8b5721b500 /Bugzilla
parent2f52dd3d089e985468b2dd3c8d6b9dce3c235f86 (diff)
downloadbugzilla-13c8f7fab8a794ce6c2796fbb949088599fb2774.tar.gz
bugzilla-13c8f7fab8a794ce6c2796fbb949088599fb2774.tar.xz
Bug 702208: TheSchwartz should not open a new db connection for each email
r=mkanat, a=mkanat
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/JobQueue.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/Bugzilla/JobQueue.pm b/Bugzilla/JobQueue.pm
index 2804b9179..7ea678345 100644
--- a/Bugzilla/JobQueue.pm
+++ b/Bugzilla/JobQueue.pm
@@ -35,6 +35,11 @@ use constant JOB_MAP => {
send_mail => 'Bugzilla::Job::Mailer',
};
+# Without a driver cache TheSchwartz opens a new database connection
+# for each email it sends. This cached connection doesn't persist
+# across requests.
+use constant DRIVER_CACHE_TIME => 300; # 5 minutes
+
sub job_map {
if (!defined(Bugzilla->request_cache->{job_map})) {
my $job_map = JOB_MAP;
@@ -62,6 +67,7 @@ sub new {
pass => $lc->{db_pass},
prefix => 'ts_',
}],
+ driver_cache_expiration => DRIVER_CACHE_TIME,
);
return $self;