mirror of https://github.com/MISP/MISP
Merge branch 'hotfix-2.3.133'
commit
88fcf39194
|
@ -1 +1 @@
|
||||||
{"major":2, "minor":3, "hotfix":131}
|
{"major":2, "minor":3, "hotfix":133}
|
|
@ -11,17 +11,20 @@ class AdminShell extends AppShell
|
||||||
$this->loadModel('Correlation');
|
$this->loadModel('Correlation');
|
||||||
$this->Correlation->deleteAll(array('id !=' => ''), false);
|
$this->Correlation->deleteAll(array('id !=' => ''), false);
|
||||||
$this->loadModel('Attribute');
|
$this->loadModel('Attribute');
|
||||||
$fields = array('Attribute.id', 'Attribute.event_id', 'Attribute.distribution', 'Attribute.cluster', 'Event.date', 'Event.org');
|
$attributeIDs = array_keys($this->Attribute->find('list'));
|
||||||
// get all attributes..
|
$total = count($attributeIDs);
|
||||||
$attributes = $this->Attribute->find('all', array('recursive' => -1));
|
$start = 0;
|
||||||
// for all attributes..
|
$continue = true;
|
||||||
$total = count($attributes);
|
while ($continue) {
|
||||||
|
|
||||||
|
$attributes = $this->Attribute->find('all', array('recursive' => -1, 'conditions' => array('AND' => array('Event.id' > $start, 'Event.id' <= ($start + 1000)))));
|
||||||
foreach ($attributes as $k => $attribute) {
|
foreach ($attributes as $k => $attribute) {
|
||||||
if ($k > 0 && $k % 1000 == 0) {
|
|
||||||
$this->Job->saveField('progress', $k/$total*100);
|
|
||||||
}
|
|
||||||
$this->Attribute->__afterSaveCorrelation($attribute['Attribute']);
|
$this->Attribute->__afterSaveCorrelation($attribute['Attribute']);
|
||||||
}
|
}
|
||||||
|
$this->Job->saveField('progress', $k/$total*100);
|
||||||
|
$start += 1000;
|
||||||
|
if ($start > $total) $continue = false;
|
||||||
|
}
|
||||||
$this->Job->saveField('progress', 100);
|
$this->Job->saveField('progress', 100);
|
||||||
$this->Job->saveField('message', 'Job done.');
|
$this->Job->saveField('message', 'Job done.');
|
||||||
$this->Job->saveField('status', 1);
|
$this->Job->saveField('status', 1);
|
||||||
|
|
Loading…
Reference in New Issue