Skip to content
Snippets Groups Projects
Commit 6a84e386 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

improve countBy fix

parent 5ac53ee6
Branches
Tags 5.13.1
3 merge requests!896Master,!827Stable,!820Hotline #23391 remove while true
......@@ -56,18 +56,7 @@ class Class_Cosmogramme_Integration_PhaseItemFacets
$this->_previous_records = $records;
foreach ($records as $record) {
$nb_items = (int) Class_Exemplaire::countBy(['id_notice' => $record->getId()]);
if($nb_items > 25)
continue;
if ($this->isTimeOut())
return $this->_resetDbConnection()
->_phase;
$this->_runOne($record);
}
$this->runUpdateForRecords($records);
$this->_resetDbConnection();
}
......@@ -91,6 +80,24 @@ class Class_Cosmogramme_Integration_PhaseItemFacets
}
protected function runUpdateForRecords($records) {
foreach ($records as $record) {
$nb_items = count(Class_Exemplaire::findAllBy(['id_notice' => $record->getId(),
'limit' => 26]));
if($nb_items > 25)
return;
if ($this->isTimeOut())
return $this->_resetDbConnection()
->_phase;
$this->_runOne($record);
}
}
protected function _runOne($record) {
// types starting with 100 are indexed at another phase
if (100 > $record->getTypeDoc())
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment