Skip to content

Commit

Permalink
fixed servers value in subclass
Browse files Browse the repository at this point in the history
  • Loading branch information
ginesr committed Apr 19, 2014
1 parent 09f055d commit ef33aab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/Gideon/Cache/Memcache.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ sub set {
my $ttl = shift;
my $class = shift;


my $class_keys = $self->_get_class_cache;
$class_keys->{$class}->{$key} = 1;

Expand Down Expand Up @@ -111,6 +110,11 @@ sub start {
return $memd;
}

sub get_servers {
my $self = shift;
return $servers;
}

sub set_servers {
my $self = shift;
my $ref = shift || [];
Expand Down
3 changes: 1 addition & 2 deletions lib/Gideon/Cache/Memcache/Fast.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ use base 'Gideon::Cache::Memcache';
use Cache::Memcached::Fast;

use constant COMPRESS_TRESH => 10_000;
our $servers = ["127.0.0.1:11211"];

sub _connect {
my $self = shift;
return new Cache::Memcached::Fast {
'servers' => $servers,
'servers' => $self->get_servers,
'compress_threshold' => COMPRESS_TRESH,
};
}
Expand Down
2 changes: 1 addition & 1 deletion t/10_cache_memcache_fast.t → t/10cache_memcache_fast.t
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ my $more_data = Example::Fast->find_all( value => { like => '%test 6' } );
my @list = Gideon::Cache::Memcache::Fast->class_keys('Example::Fast');

is( $more_data->records_found, 1, 'One record found' );
is( scalar @list, 2, 'Keys for class' );
is( scalar @list, 1, 'Keys for class' );

empty_table();

Expand Down

0 comments on commit ef33aab

Please sign in to comment.