Committer: gprochaev
Tiny code updateU trunk/cgi-bin/LJ/FileStore.pm
Modified: trunk/cgi-bin/LJ/FileStore.pm =================================================================== --- trunk/cgi-bin/LJ/FileStore.pm 2010-09-22 07:14:30 UTC (rev 9527) +++ trunk/cgi-bin/LJ/FileStore.pm 2010-09-22 07:21:50 UTC (rev 9528) @@ -31,20 +31,21 @@ my $dbh = LJ::get_db_reader(); my ($file_info, $paths) = (); - $paths = LJ::MogileFS::Frontend->get_paths($args{path}); + my $path = $args{path}; + $paths = LJ::MogileFS::Frontend->get_paths($path); - if (!$LJ::FILES{$args{path}}) { - $file_info = LJ::MemCache::get($args{path}); + if (!$LJ::FILES{$path}) { + $file_info = LJ::MemCache::get($path); if (!$file_info) { my $cache_for = $LJ::MOGILE_PATH_CACHE_TIMEOUT || 3600; - $file_info = $dbh->selectrow_hashref("SELECT mime_type, content_length, change_time FROM files WHERE path = ?", undef, $args{path}); - LJ::MemCache::set($args{path}, $file_info, $cache_for); + $file_info = $dbh->selectrow_hashref("SELECT mime_type, content_length, change_time FROM files WHERE path = ?", undef, $path); + LJ::MemCache::set($path, $file_info, $cache_for); } - $LJ::FILES{$args{path}} = $file_info; + $LJ::FILES{$path} = $file_info; } - $LJ::FILES{$args{path}}->{paths} = $paths; + $LJ::FILES{$path}->{paths} = $paths; - return $LJ::FILES{$args{path}}; + return $LJ::FILES{$path}; } 1;