move create_user to perl API
authorroot <root@rsync1.maxxo.com>
Wed, 11 Apr 2012 20:25:36 +0000 (22:25 +0200)
committerroot <root@rsync1.maxxo.com>
Wed, 11 Apr 2012 20:25:36 +0000 (22:25 +0200)
gearman/send_file.pl

index 4c5820f..a3eabd6 100755 (executable)
@@ -21,6 +21,21 @@ use Gearman::Worker;
 my $worker = Gearman::Worker->new;
 $worker->job_servers('127.0.0.1:4730');
 
+=head2 create_user
+
+=cut
+
+$worker->register_function( create_user => sub {
+       my ($job) = @_;
+
+       my $work = $job->arg;
+       chomp $work;
+       warn "# create_user [$work]\n";
+       my ( $email, $password, $quota ) = split(/\s+/,$work,3);
+       $quota ||= 200000 && warn "default quota";
+       $api->create_user( $email, $password, $quota );
+});
+
 =head2 send_file ~u2001/from.txt#~u2003/dir/new to.txt
 
 =cut