Changeset 24347
- Timestamp:
- Jun 5, 2009, 4:08:32 PM (17 years ago)
- Location:
- trunk/Nebulous-Server
- Files:
-
- 4 edited
-
Build.PL (modified) (1 diff)
-
Changes (modified) (1 diff)
-
lib/Nebulous/Server.pm (modified) (5 diffs)
-
lib/Nebulous/Server/Config.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/Build.PL
r23932 r24347 10 10 requires => { 11 11 'Apache2::Const' => 0, 12 'Cache::Memcached::Managed' => '0.20', 12 13 'Class::Accessor::Fast' => 0, 13 14 'Config::YAML' => '1.42', -
trunk/Nebulous-Server/Changes
r24304 r24347 2 2 3 3 0.17 4 - add basic valid key caching via memcached 4 5 - add params checking to Nebulous::Key::parse_neb_key() 5 6 - restrict creation/modification/remove of xattrs to the user.* namespace -
trunk/Nebulous-Server/lib/Nebulous/Server.pm
r24337 r24347 27 27 use Params::Validate qw( validate validate_pos SCALAR SCALARREF UNDEF BOOLEAN ); 28 28 use URI::file; 29 30 __PACKAGE__->mk_accessors(qw( log sql config )); 29 use Cache::Memcached::Managed; 30 31 __PACKAGE__->mk_accessors(qw( log sql config cache )); 31 32 32 33 use constant SUBPATH_DEPTH => 2; … … 62 63 $self->sql($sql); 63 64 $self->config($config); 64 65 $self->cache(Cache::Memcached::Managed->new($config->memcached)); 65 66 $log->debug( "leaving" ); 66 67 … … 1577 1578 # remove it too 1578 1579 if ( $instances == 1 ) { 1580 # remove key from cache 1581 $self->cache->delete($key->path); 1582 1579 1583 # we just removed the last instance 1580 1584 my $query = $db->prepare_cached( $sql->delete_object ); … … 1895 1899 $log->logdie("$@") if $@; 1896 1900 1901 # check cache first 1902 my $cached = $self->cache->get($key->path); 1903 if (defined $cached) { 1904 $log->debug( "key $key found in cache" ); 1905 $log->debug( "leaving" ); 1906 return 1; 1907 } else { 1908 $log->debug( "key $key not found in cache" ); 1909 } 1910 1897 1911 my $db = $self->db($key); 1898 1912 … … 1911 1925 1912 1926 if (defined $ext_id) { 1913 $log->debug( "key is valid" );1927 $log->debug( "key found in db" ); 1914 1928 $log->debug( "leaving" ); 1915 1929 return 1; 1916 1930 } 1917 1931 1918 $log->debug( "key not found " );1932 $log->debug( "key not found in db" ); 1919 1933 $log->debug( "leaving" ); 1920 1934 -
trunk/Nebulous-Server/lib/Nebulous/Server/Config.pm
r23932 r24347 49 49 dbuser => { type => SCALAR, optional => 1 }, 50 50 dbpasswd => { type => SCALAR, optional => 1 }, 51 memcached => { type => SCALAR, default => '127.0.0.1:11311' }, 51 52 }; 52 53
Note:
See TracChangeset
for help on using the changeset viewer.
