Skip to content

Commit

Permalink
Try to reset connection every cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Dec 18, 2023
1 parent 4236094 commit a042602
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Discomp/Importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
use Exception;
use AbraFlexi\RO;
use AbraFlexi\RW;
use WyriHaximus\FileDescriptors\Factory;
use WyriHaximus\FileDescriptors\ListerInterface;

/**
* Description of Importer
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -306,7 +305,6 @@ public function freshItems()
}

$this->updatePrice($activeItemData);
$this->sokoban->disconnect();
}
}

Expand Down Expand Up @@ -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']);
Expand Down

0 comments on commit a042602

Please sign in to comment.