#!/usr/bin/env perl
use strict;
use warnings;
use Gearman::Driver;
use lib 'lib';


$SIG{__WARN__} = sub { print STDERR @_ if $ENV{DEBUG} };

my $driver = Gearman::Driver->new(
	namespaces => [qw(APKPM)],
	configfile => 'config.yaml',
	loglevel   => 'DEBUG',
	logfile    => 'log/gearman.log',
	server     => $ENV{GEARMAN} || 'localhost:4730',
	interval   => 3,
	job_runtime_attributes => {
		'APKPM::Poll::ip_username' => {
			max_processes => 100,
			min_processes => 1,
		},
		'APKPM::Ping::ping' => {
			max_processes => 100,
		},
		'APKPM::Davolink::info' => {
			max_processes => 60,
		},
		'APKPM::Store::insert' => {
			max_processes => 10,
		},
	},
);
$driver->run;
