Changeset 24372
- Timestamp:
- Jun 10, 2009, 3:30:24 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Nebulous-Server/lib/Nebulous/Server.pm (modified) (4 diffs)
-
Nebulous-Server/lib/Test/Nebulous.pm (modified) (3 diffs)
-
Nebulous-Server/t/05_server_replicate_object.t (modified) (1 diff)
-
Nebulous/t/conf/startup.pl.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/lib/Nebulous/Server.pm
r24369 r24372 516 516 } 517 517 518 $self->cache->delete($key->path) if defined $self->cache; 519 $self->cache->set($newkey->path, 1) if defined $self->cache; 520 518 521 $db->commit; 519 522 $log->debug("commit"); … … 1930 1933 my $cached = $self->cache->get($key->path) if defined $self->cache; 1931 1934 if (defined $cached) { 1932 $log->debug( "key $key found in cache ");1935 $log->debug( "key $key found in cache as ", $key->path ); 1933 1936 $log->debug( "leaving" ); 1934 1937 return 1; … … 1956 1959 # add key to cache 1957 1960 $self->cache->set($key->path, 1) if defined $self->cache; 1958 $log->debug( "key added to cache ");1961 $log->debug( "key added to cache as ", $key->path ); 1959 1962 $log->debug( "leaving" ); 1960 1963 return 1; … … 1970 1973 sub _is_valid_volume_name 1971 1974 { 1972 my ($self, $key, $vol_name) = @_;1975 my $self = shift; 1973 1976 1974 1977 my $log = $self->log; 1975 1978 $log->debug( "entered - @_" ); 1979 1980 my ($key, $vol_name) = @_; 1976 1981 1977 1982 my $sql = $self->sql; -
trunk/Nebulous-Server/lib/Test/Nebulous.pm
r19493 r24372 11 11 use base qw( Exporter ); 12 12 13 use Cache::Memcached; 13 14 use DBI; 14 15 use File::Path qw( mkpath rmtree ); … … 16 17 use Nebulous::Server::SQL; 17 18 18 our @EXPORT = qw( $NEB_DB $NEB_USER $NEB_PASS );19 our @EXPORT = qw( $NEB_DB $NEB_USER $NEB_PASS $NEB_MEMCACHED_SERVERS); 19 20 20 21 our $NEB_DB = $ENV{'NEB_DB'} || "DBI:mysql:database=test:host=localhost"; 21 22 our $NEB_USER = $ENV{'NEB_USER'} || "test"; 22 23 our $NEB_PASS = $ENV{'NEB_PASS'} || ''; 24 our $NEB_MEMCACHED_SERVERS = ['127.0.0.1:11211']; 23 25 24 26 my $dbh = DBI->connect( $NEB_DB, $NEB_USER, $NEB_PASS ); … … 83 85 84 86 sub cleanup { 87 # memcached needs to be emptied between test runs 88 Cache::Memcached->new(servers => $NEB_MEMCACHED_SERVERS)->flush_all; 89 # if flush_all() turns out to be useless as feared 90 # my $memd = Cache::Memcached->new(servers => $NEB_MEMCACHED_SERVERS); 91 # my $query = $dbh->prepare("SELECT ext_id FROM storage_object"); 92 # if ($query->execute) { 93 # while (my $row = $query->fetchrow_hashref) { 94 # my $ext_id = $row->{ext_id}; 95 # warn "found key $ext_id\n" if $memd->get($ext_id); 96 # warn "deleted $ext_id\n" if $memd->delete($ext_id); 97 # } 98 # } 99 # $query->finish; 100 85 101 foreach my $statement (@{ $sql->get_db_clear }) { 86 102 $dbh->do( $statement ); -
trunk/Nebulous-Server/t/05_server_replicate_object.t
r24356 r24372 24 24 dbuser => $NEB_USER, 25 25 dbpasswd => $NEB_PASS, 26 memcached_servers => $NEB_MEMCACHED_SERVERS, 26 27 ); 27 28 -
trunk/Nebulous/t/conf/startup.pl.in
r23934 r24372 18 18 my $config = Nebulous::Server::Config->new( 19 19 trace => 'all', 20 memcached_servers => ['127.0.0.1:11211'], 20 21 ); 21 22 $config->add_db(
Note:
See TracChangeset
for help on using the changeset viewer.
