use do_high for CRM_search
[APKPM.git] / persistant_worker.pl
index 647b2bd..42dabe8 100755 (executable)
@@ -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
                                },