mirror of https://github.com/MISP/MISP
chg: [performance] Reworked the pre-fetching of event IDs for the events/restSearch endpoint
- no need to count all existing hits in a non paginated situation. Simply use the result countpull/4529/head
parent
5a3d36eb76
commit
615f92e41a
|
@ -1520,17 +1520,18 @@ class Event extends AppModel
|
|||
'recursive' => -1,
|
||||
'fields' => $fields
|
||||
);
|
||||
|
||||
// Get the count (but not the actual data) of results for paginators
|
||||
$result_count = $this->find('count', $find_params);
|
||||
|
||||
if (isset($params['limit'])) {
|
||||
// Get the count (but not the actual data) of results for paginators
|
||||
$result_count = $this->find('count', $find_params);
|
||||
$find_params['limit'] = $params['limit'];
|
||||
if (isset($params['page'])) {
|
||||
$find_params['page'] = $params['page'];
|
||||
}
|
||||
}
|
||||
$results = $this->find('list', $find_params);
|
||||
if (!isset($params['limit'])) {
|
||||
$result_count = count($results);
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
@ -5936,6 +5937,7 @@ class Event extends AppModel
|
|||
}
|
||||
$filters['include_attribute_count'] = 1;
|
||||
$eventid = $this->filterEventIds($user, $filters, $elementCounter);
|
||||
throw new Exception();
|
||||
$eventCount = count($eventid);
|
||||
$eventids_chunked = $this->__clusterEventIds($exportTool, $eventid);
|
||||
unset($eventid);
|
||||
|
|
Loading…
Reference in New Issue