Archived
1
0

Try a fix

This commit is contained in:
Mercier Pierre-Olivier 2013-12-01 06:04:37 +01:00
parent d077a5933f
commit bbde682896
2 changed files with 4 additions and 4 deletions

View File

@ -24,12 +24,12 @@ close $cpuinfo;
our @servers = ("gearmand-srv:4730"); our @servers = ("gearmand-srv:4730");
sub add_server(@) sub add_server
{ {
push @servers, @_; push @servers, @_;
} }
sub set_servers(@) sub set_servers
{ {
@servers = @_; @servers = @_;
} }
@ -139,7 +139,7 @@ sub register ($$;$$)
my $worker = Gearman::Worker->new; my $worker = Gearman::Worker->new;
log DEBUG, "Registering function $funcname on ", join(", ", @servers); log INFO, "Registering function $funcname on ", join(", ", @servers);
$worker->job_servers( @servers ); $worker->job_servers( @servers );
$worker->register_function($funcname => sub { return do_work($subref, $given_arg, $priority, @_); }); $worker->register_function($funcname => sub { return do_work($subref, $given_arg, $priority, @_); });

View File

@ -105,5 +105,5 @@ sub process
return $out; return $out;
} }
Process::add_server("gearman:4730"); Process::set_servers("gearman:4730");
Process::register_no_parse("get_csv", \&process); Process::register_no_parse("get_csv", \&process);