chg: [appModel] Removed prio worker from the list of available workers

to perform an update
pull/6370/head
mokaddem 2020-10-01 09:28:02 +02:00
parent 6d21f1696a
commit 2fdcede6b6
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 7 additions and 5 deletions

View File

@ -1235,8 +1235,12 @@ class ServersController extends AppController
public function getWorkers()
{
$issues = 0;
$worker_array = $this->Server->workerDiagnostics($issues);
if (Configure::read('MISP.background_jobs')) {
$workerIssueCount = 0;
$worker_array = $this->Server->workerDiagnostics($workerIssueCount);
} else {
$worker_array = [__('Background jobs not enabled')];
}
return $this->RestResponse->viewData($worker_array);
}

View File

@ -1888,9 +1888,7 @@ class AppModel extends Model
$workerType = '';
if (isset($workerDiagnostic['update']['ok']) && $workerDiagnostic['update']['ok']) {
$workerType = 'update';
} elseif (isset($workerDiagnostic['prio']['ok']) && $workerDiagnostic['prio']['ok']) {
$workerType = 'prio';
} else { // no worker running, doing inline update
} else { // update worker not running, doing the update inline
return $this->runUpdates($verbose, false);
}
$this->Job->create();