Skip to content

Commit ce5bbc1

Browse files
committed
Added memory config verification
1 parent 8147701 commit ce5bbc1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/VWF/Display.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use Template::Plugin::EnvHash;
2727
use Template::Plugin::Math;
2828
use Template::Plugin::JSON;
2929
use HTML::SocialMedia;
30-
use VWF::Utils qw(create_memory_cache create_disc_cache);
30+
use VWF::Utils qw(create_memory_cache);
3131
use Error;
3232
use Fatal qw(:void open);
3333
use File::pfopen;

lib/VWF/Utils.pm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ sub _validate_cache_config($config, $cache_type) {
204204
croak('Port must be between 1 and 65535')
205205
unless $port >= 1 && $port <= 65535;
206206
}
207+
208+
# Validate memory parameters
209+
if(exists($cache_config->{'datastore'}) && exists($cache_config->{'global'}) && (my $driver = $cache_config->{'driver'})) {
210+
# CHI catches this as well, but putting it here helps to track the error
211+
croak('Memory cache cannot have both global and datastore');
212+
}
207213
}
208214

209215
sub _get_default_driver($cache_type, $logger) {

0 commit comments

Comments
 (0)