From cfe0a727c0094904b54770cfca6a2ea29a5c2439 Mon Sep 17 00:00:00 2001 From: miker Date: Tue, 12 Apr 2005 15:11:50 +0000 Subject: [PATCH] cach update git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@275 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/OpenSRF/Utils/Cache.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/perlmods/OpenSRF/Utils/Cache.pm b/src/perlmods/OpenSRF/Utils/Cache.pm index 279adde..6b73f1f 100644 --- a/src/perlmods/OpenSRF/Utils/Cache.pm +++ b/src/perlmods/OpenSRF/Utils/Cache.pm @@ -1,12 +1,14 @@ package OpenSRF::Utils::Cache; use strict; use warnings; -use base qw/Cache::Memcached OpenSRF/; +use base qw/OpenSRF/; use Cache::Memcached; +use OpenSRF::Utils::Logger qw/:level/; use OpenSRF::Utils::Config; use OpenSRF::Utils::SettingsClient; use OpenSRF::EX qw(:try); use JSON; +my $log = 'OpenSRF::Utils::Logger'; =head OpenSRF::Utils::Cache @@ -101,7 +103,9 @@ sub put_cache { $expiretime ||= $max_persist_time; $self->{memcache}->set( $key, $value, $expiretime ) || - throw OpenSRF::EX::ERROR ("Unable to store $key => $value in memcached server" );; + throw OpenSRF::EX::ERROR ("Unable to store $key => $value in memcached server" ); + + $log->debug("Stored $key => $value in memcached server", INTERNAL); if($self->{"persist"}) { @@ -142,7 +146,7 @@ sub get_cache { my($self, $key ) = @_; my $val = $self->{memcache}->get( $key ); - return $val if defined($val); + return JSON->JSON2perl($val) if defined($val); if($self->{persist}){ _load_methods(); } -- 2.11.0