From a042602022b83a9c23fde64bff20daab101149de Mon Sep 17 00:00:00 2001 From: CyberVitexus Date: Mon, 18 Dec 2023 01:00:33 +0100 Subject: [PATCH] Try to reset connection every cycle --- src/Discomp/Importer.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Discomp/Importer.php b/src/Discomp/Importer.php index 400c732..d13d901 100644 --- a/src/Discomp/Importer.php +++ b/src/Discomp/Importer.php @@ -15,8 +15,6 @@ use Exception; use AbraFlexi\RO; use AbraFlexi\RW; -use WyriHaximus\FileDescriptors\Factory; -use WyriHaximus\FileDescriptors\ListerInterface; /** * Description of Importer @@ -205,7 +203,8 @@ public function freshItems() $errors = 0; $freshItems = $this->getFreshItems(); foreach ($freshItems as $pos => $activeItemData) { - $this->sokoban->curlInit(); + $this->sokoban->connectionReset(); + $this->category->connectionReset(); $this->sokoban->dataReset(); $discompItemCode = $activeItemData['CODE']; $this->sokoban->setObjectName('(' . $pos . '/' . count($freshItems) . ') StoreItem:' . $discompItemCode); @@ -306,7 +305,6 @@ public function freshItems() } $this->updatePrice($activeItemData); - $this->sokoban->disconnect(); } } @@ -436,6 +434,7 @@ public function allTimeItems() */ public function updatePrice($activeItemData) { + $this->pricer->connectionReset(); $this->pricer->unsetDataValue('id'); $this->pricer->setDataValue('cenik', $this->sokoban); $this->pricer->setDataValue('kodIndi', $activeItemData['CODE']);