X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=gearman%2Ftransmission.pl;h=6e6e04a95c7e853b64132ed753ba7025378708d5;hb=667d0832254ac6c00637b0b619ecce8081407d8c;hp=a66f771ec7e615529104b3e83ae0526c39449912;hpb=c76a92098b8753073c3378a994a77913a90b92fa;p=cloudstore.git diff --git a/gearman/transmission.pl b/gearman/transmission.pl index a66f771..6e6e04a 100755 --- a/gearman/transmission.pl +++ b/gearman/transmission.pl @@ -24,7 +24,8 @@ my $j = JSON::XS->new; $j->allow_blessed(1); $j->convert_blessed(0); -use TokyoCabinet; +use lib 'lib'; +use CloudStore::MD5sum; my $name = $ENV{ZSLICE} || die "need ZSLICE"; my $torrent_dir = "/$name/torrent"; @@ -132,11 +133,7 @@ $worker->register_function( $name . '_torrent_share' => sub { my $path = $work; my $dir = (getpwnam($user))[7] || die "no user $user"; - my $md5_path = "$dir/.md5"; - my %h; - tie %h, "TokyoCabinet::HDB", $md5_path || die "$md5_path: $!"; - my $md5 = $h{$path} || die "can't find $path in $md5_path"; - untie %h; + my $md5 = CloudStore::MD5sum->md5_get( "$dir/$path" ); warn "# $md5 $path";