From: erickson Date: Fri, 4 Mar 2005 21:56:32 +0000 (+0000) Subject: added _CACHEVAL_ to the slot names to make them a little more unique/controlled X-Git-Tag: osrf_rel_2_0_1~1697 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=329a69aeca89f08be066d6b26e030caf2772995a;p=OpenSRF.git added _CACHEVAL_ to the slot names to make them a little more unique/controlled git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@175 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/OpenSRF/Utils/Cache.pm b/src/perlmods/OpenSRF/Utils/Cache.pm index 39a09c6..2aaf2d4 100644 --- a/src/perlmods/OpenSRF/Utils/Cache.pm +++ b/src/perlmods/OpenSRF/Utils/Cache.pm @@ -92,20 +92,20 @@ sub put_cache { if($self->{"persist"}) { - my ($slot) = $persist_add_slot->run($key, $expiretime . "s"); + my ($slot) = $persist_add_slot->run("_CACHEVAL_$key", $expiretime . "s"); if(!$slot) { # slot may already exist - ($slot) = $persist_slot_find->run($key); + ($slot) = $persist_slot_find->run("_CACHEVAL_$key"); if(!defined($slot)) { throw OpenSRF::EX::ERROR ("Unable to create cache slot $key in persist server" ); } } - ($slot) = $persist_push_stack->run($slot, $value); + ($slot) = $persist_push_stack->run("_CACHEVAL_$slot", $value); if(!$slot) { - throw OpenSRF::EX::ERROR ("Unable to push data onto stack in persist slot $key" ); + throw OpenSRF::EX::ERROR ("Unable to push data onto stack in persist slot _CACHEVAL_$key" ); } } @@ -118,7 +118,7 @@ sub delete_cache { _load_methods(); $self->{memcache}->delete($key); if( $self->{persist} ) { - $persist_destroy_slot->run($key); + $persist_destroy_slot->run("_CACHEVAL_$key"); } return $key; } @@ -133,9 +133,9 @@ sub get_cache { # if not in memcache but we are persisting, the put it into memcache if( $self->{"persist"} ) { - $val = $persist_peek_stack->( $key ); + $val = $persist_peek_stack->( "_CACHEVAL_$key" ); if(defined($val)) { - my ($expire) = $persist_slot_get_expire->run($key); + my ($expire) = $persist_slot_get_expire->run("_CACHEVAL_$key"); if($expire) { $self->{memcache}->set( $key, $val, $expire); } else {