Skip to content
Snippets Groups Projects
Commit 95ad9eaf authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline#17208_memory_leak' into 'hotline_6.54'

Hotline#17208 memory leak

See merge request !492
parents 877a1dbd d374b05a
Branches
Tags
5 merge requests!529Hotline 6.56,!512Master,!500Hotline 6.55,!498Master,!496Hotline 6.54
......@@ -6,9 +6,19 @@ class Class_Batch_IndexRessourcesNumeriques extends Class_Batch_Abstract {
}
public function run() {
$albums = Class_Album::findAll();
foreach ($albums as $album)
$album->index();
$current_page = -1;
do {
$albums = Class_Album::findAllBy(['limitPage' => [$current_page += 1,
100]]);
foreach ($albums as $album)
$album->index();
Class_Album::clearCache();
Class_AlbumRessource::clearCache();
Class_Notice::clearCache();
Class_Exemplaire::clearCache();
} while(count($albums) > 0);
(new Storm_Cache())->clean();
}
......
......@@ -16,11 +16,11 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_WebService_BibNumerique_Cyberlibris_LivresNumeriquesReader extends Class_WebService_DublinCoreParser {
class Class_WebService_BibNumerique_Cyberlibris_LivresNumeriquesReader extends Class_WebService_DublinCoreParser {
protected $_total_count;
protected $_page_number;
protected $_page_size;
......
......@@ -16,11 +16,11 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_WebService_BibNumerique_RessourceNumerique {
protected $_id;
protected $_title;
protected $_description;
......@@ -180,7 +180,7 @@
public function getPhotos() {
return $this->_photos;
}
public function getMatieres() {
return implode($this->_matieres,'::');
......@@ -209,7 +209,7 @@
public function importMatieres($album) {
$ids=[];
$indexation = new Class_Indexation();
foreach ($this->_matieres as $matiere_libelle) {
foreach ($this->_matieres as $matiere_libelle) {
if ( $matiere=Class_CodifMatiere::findFirstBy(['libelle' => $matiere_libelle])) {
$ids[]=$matiere->getId();
continue;
......@@ -220,7 +220,7 @@
$matiere->setCodeAlpha($indexation->alphaMaj($matiere_libelle));
$matiere->save();
$ids[]=$matiere->getId();
}
if ($ids)
$album->setMatiere(implode(';',$ids));
......@@ -240,7 +240,7 @@
->setUrlOrigine($this->getBaseUrl())
->setCategorie($categorie)
->setRessources($this->getRessources());
$this->importMatieres($album);
......@@ -252,6 +252,8 @@
if ($album->save())
Class_WebService_BibNumerique_Vignette::getInstance()->updateAlbum($album);
Class_Album::clearCache();
Class_AlbumRessource::clearCache();
return $album;
}
......@@ -263,7 +265,7 @@
->findFirstBy(array('libelle' => $libelle,
'parent_id' => 0));
if (null != $category)
if (null != $category)
return $category;
$category = Class_AlbumCategorie::newInstance(['libelle' => $libelle]);
......@@ -291,10 +293,10 @@
foreach ($this->_trailers as $url)
$album->addTrailerUri($url);
foreach ($this->_photos as $url)
$album->addPhotoUri($url);
$album->setExternalUri($this->getExternalUri());
return $this;
}
......@@ -314,7 +316,7 @@
public function getRessourceCategorieLibelle(){}
public function getBaseUrl() {}
public function setOaiId($id) {
if (!$id)
......
storm @ 7efa0a17
Subproject commit 43139b708408945afa30c7ec40d1f5551ea1353a
Subproject commit 7efa0a17a52411b345f7975f7852c85dfd39b378
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