fix: [correlation] Fix over correlating value

pull/8692/head
Jakub Onderka 2022-10-21 14:37:37 +02:00
parent a09721292e
commit 332264fe9d
1 changed files with 7 additions and 10 deletions

View File

@ -43,9 +43,10 @@ class OverCorrelatingValue extends AppModel
public function block($value)
{
if (!$this->isBlocked($value)) {
$value = self::truncate($value);
$this->create();
$this->save([
'value' => self::truncate($value),
'value' => $value,
'occurrence' => 0
]);
$this->blockedValues[$value] = true;
@ -58,12 +59,10 @@ class OverCorrelatingValue extends AppModel
*/
public function unblock($value)
{
$this->deleteAll(
[
'OverCorrelatingValue.value' => self::truncate($value)
],
false
);
$value = self::truncate($value);
$this->deleteAll([
'OverCorrelatingValue.value' => $value,
], false);
$this->blockedValues[$value] = false;
}
@ -126,10 +125,8 @@ class OverCorrelatingValue extends AppModel
true,
$jobId
);
return $jobId;
} else {
return $this->generateOccurrences();
$this->generateOccurrences();
}
}