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

@ -160,9 +160,9 @@ class BuildService
}
$config = Config::getInstance();
$settings = $config->get('php-censor.worker', []);
$settings = $config->get('php-censor.queue', []);
if (!empty($settings['host']) && !empty($settings['queue'])) {
if (!empty($settings['host']) && !empty($settings['name'])) {
try {
$jobData = [
'type' => 'php-censor.build',
@ -174,12 +174,12 @@ class BuildService
}
$pheanstalk = new Pheanstalk($settings['host']);
$pheanstalk->useTube($settings['queue']);
$pheanstalk->useTube($settings['name']);
$pheanstalk->put(
json_encode($jobData),
PheanstalkInterface::DEFAULT_PRIORITY,
PheanstalkInterface::DEFAULT_DELAY,
$config->get('php-censor.worker.job_timeout', 600)
$config->get('php-censor.queue.lifetime', 600)
);
} catch (\Exception $ex) {
$this->queueError = true;