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:
parent
516abc4896
commit
efd26a44d5
1 changed files with 9 additions and 8 deletions
|
@ -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 );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue