Renamed app config worker section to queue + removed max_jobs option (use supervisord)
This commit is contained in:
parent
b5e96aa94c
commit
0ca5c8de51
5 changed files with 15 additions and 46 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue