Bug 7432 : Fixing caching for C4::Languages

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Chris Cormack 2012-02-03 12:44:17 +13:00 committed by Paul Poulain
parent 516abc4896
commit efd26a44d5

View file

@ -30,15 +30,16 @@ eval {
if ($servers) { if ($servers) {
require Memoize::Memcached; require Memoize::Memcached;
import Memoize::Memcached qw(memoize_memcached); import Memoize::Memcached qw(memoize_memcached);
my $memcached = {
servers => [ $servers ],
key_prefix => C4::Context->config('memcached_namespace') || 'koha',
};
memoize_memcached('getTranslatedLanguages', memcached => $memcached, expire_time => 600); #cache for 10 minutes my $memcached = {
memoize_memcached('getFrameworkLanguages' , memcached => $memcached, expire_time => 600); servers => [$servers],
memoize_memcached('getAllLanguages', memcached => $memcached, expire_time => 600); key_prefix => C4::Context->config('memcached_namespace') || 'koha',
expire_time => 600
}; # cache for 10 mins
memoize_memcached( 'getTranslatedLanguages', memcached => $memcached );
memoize_memcached( 'getFrameworkLanguages', memcached => $memcached );
memoize_memcached( 'getAllLanguages', memcached => $memcached );
} }
}; };