mirror of https://github.com/MISP/MISP
Merge pull request #8409 from JakubOnderka/fix-chaning-correlations
fix: [internal] Enabling/disabling correlationspull/8412/head
commit
c22d3baded
|
@ -109,19 +109,13 @@ class AdminShell extends AppShell
|
|||
|
||||
public function jobPurgeCorrelation()
|
||||
{
|
||||
$this->ConfigLoad->execute();
|
||||
if (empty($this->args[0])) {
|
||||
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Purge correlation'] . PHP_EOL);
|
||||
}
|
||||
|
||||
$jobId = $this->args[0];
|
||||
$this->loadModel('Job');
|
||||
$this->Job->id = $jobId;
|
||||
$this->loadModel('Attribute');
|
||||
$this->Attribute->purgeCorrelations();
|
||||
$this->Job->saveField('progress', 100);
|
||||
$this->Job->saveField('message', 'Job done.');
|
||||
$this->Job->saveField('status', 4);
|
||||
$this->Job->saveStatus($jobId);
|
||||
}
|
||||
|
||||
public function jobGenerateShadowAttributeCorrelation()
|
||||
|
|
|
@ -2002,12 +2002,12 @@ class Server extends AppModel
|
|||
if (!Configure::read('MISP.background_jobs')) {
|
||||
$this->Attribute = ClassRegistry::init('Attribute');
|
||||
if ($value) {
|
||||
$k = $this->Attribute->purgeCorrelations();
|
||||
$this->Attribute->purgeCorrelations();
|
||||
} else {
|
||||
$k = $this->Attribute->generateCorrelation();
|
||||
$this->Attribute->generateCorrelation();
|
||||
}
|
||||
} else {
|
||||
if ($value == true) {
|
||||
if ($value) {
|
||||
$jobType = 'jobPurgeCorrelation';
|
||||
$jobTypeText = 'purge correlations';
|
||||
} else {
|
||||
|
@ -2029,7 +2029,6 @@ class Server extends AppModel
|
|||
BackgroundJobsTool::DEFAULT_QUEUE,
|
||||
BackgroundJobsTool::CMD_ADMIN,
|
||||
[
|
||||
'updateAfterPull',
|
||||
$jobType,
|
||||
$jobId
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue