X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=persistant_worker.pl;h=42dabe86e62ae2a7ee3087ea76029ac29382105e;hb=b7ad83dc3edd53f4023f67440774c636e120cec2;hp=647b2bdf4646df332fad89917b981d3c52e849be;hpb=93b042750d2b467c18608b056437fc3a120ee3ec;p=APKPM.git diff --git a/persistant_worker.pl b/persistant_worker.pl index 647b2bd..42dabe8 100755 --- a/persistant_worker.pl +++ b/persistant_worker.pl @@ -76,7 +76,7 @@ foreach my $ip ( keys %$poll ) { methods => [ { decode => 'd_json', -# encode => 'e_json', + encode => 'e_json', name => $method, body => sub { @@ -100,10 +100,10 @@ foreach my $ip ( keys %$poll ) { if ( $@ ) { $redis->sadd("$variant.$ip.error" => $@); - return "error: $@"; + return { error => $@ }; } elsif ( ! $hash ) { $redis->sadd("$variant.$ip.empty" => $port); - return "empty"; + return { error => 'empty' }; } else { $redis->sadd("$variant.$ip.ok" => $port); } @@ -114,10 +114,10 @@ foreach my $ip ( keys %$poll ) { username => $username, timestamp => $self->datetime_now, variant => $variant, - h => $self->to_hstore($hash), + h => $hash, }); - return "ok $username $ip $port"; # body end + return $hash; # body end # XXX -- worker body },