Renamed app config worker section to queue + removed max_jobs option (use supervisord)

This commit is contained in:
Dmitry Khomutov 2017-01-23 22:41:02 +07:00
commit 0ca5c8de51
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
5 changed files with 15 additions and 46 deletions

View file

@ -73,16 +73,15 @@ class WorkerCommand extends Command
define('DEBUG_MODE', true);
}
$config = Config::getInstance()->get('php-censor.worker', []);
$config = Config::getInstance()->get('php-censor.queue', []);
if (empty($config['host']) || empty($config['queue'])) {
if (empty($config['host']) || empty($config['name'])) {
$error = 'The worker is not configured. You must set a host and queue in your config.yml file.';
throw new \Exception($error);
}
$worker = new BuildWorker($config['host'], $config['queue']);
$worker = new BuildWorker($config['host'], $config['name']);
$worker->setLogger($this->logger);
$worker->setMaxJobs(Config::getInstance()->get('php-censor.worker.max_jobs', -1));
$worker->startWorker();
}
}