methods => [
{
decode => 'd_json',
-# encode => 'e_json',
+ encode => 'e_json',
name => $method,
body => sub {
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);
}
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
},