Skip to content

Commit 5cda5d0

Browse files
committed
Clean more caches on exit
1 parent 2e963e2 commit 5cda5d0

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

cgi-bin/page.fcgi

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ Log::WarnDie->filter(\&filter);
8080

8181
my $vwflog; # Location of the vwf.log file, read in from the config file - default = logdir/vwf.log
8282

83-
my $infocache;
84-
my $linguacache;
83+
my $info_cache;
84+
my $lingua_cache;
8585
my $buffercache;
8686

8787
my $script_dir = $info->script_dir();
@@ -242,6 +242,15 @@ $logger->info('Shutting down');
242242
if($buffercache) {
243243
$buffercache->purge();
244244
}
245+
if($rate_limit_cache) {
246+
$rate_limit_cache->purge();
247+
}
248+
if($info_cache) {
249+
$info_cache->purge();
250+
}
251+
if($lingua_cache) {
252+
$lingua_cache->purge();
253+
}
245254
CHI->stats->flush();
246255
Log::WarnDie->dispatcher(undef);
247256
exit(0);
@@ -257,10 +266,10 @@ sub doit
257266

258267
$config ||= VWF::Config->new({ logger => $logger, info => $info, debug => $params{'debug'} });
259268
$vwflog ||= $config->vwflog() || File::Spec->catfile($info->logdir(), 'vwf.log');
260-
$infocache ||= create_memory_cache(config => $config, logger => $logger, namespace => 'CGI::Info');
269+
$info_cache ||= create_memory_cache(config => $config, logger => $logger, namespace => 'CGI::Info');
261270

262271
my $options = {
263-
cache => $infocache,
272+
cache => $info_cache,
264273
logger => $logger
265274
};
266275

@@ -273,12 +282,12 @@ sub doit
273282
}
274283
$info = CGI::Info->new($options);
275284

276-
$linguacache ||= create_memory_cache(config => $config, logger => $logger, namespace => 'CGI::Lingua');
285+
$lingua_cache ||= create_memory_cache(config => $config, logger => $logger, namespace => 'CGI::Lingua');
277286

278287
# Language negotiation
279288
my $lingua = CGI::Lingua->new({
280289
supported => [ 'en-gb' ],
281-
cache => $linguacache,
290+
cache => $lingua_cache,
282291
info => $info,
283292
logger => $logger,
284293
debug => $params{'debug'},

lib/VWF/Display.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ sub set_cookie
365365
return $self;
366366
}
367367

368+
# Returns the HTTP header section, terminated by an empty line
368369
sub http
369370
{
370371
my $self = shift;

0 commit comments

Comments
 (0)