Skip to content

Commit 0543cc3

Browse files
committed
After upgrade service images are not available
PLCR18MAG-24
1 parent 18a2fe9 commit 0543cc3

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

PacklinkPro/Controller/Adminhtml/Content/Dashboard.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use Magento\Framework\View\Result\PageFactory;
1717
use Packlink\PacklinkPro\Bootstrap;
1818
use Packlink\PacklinkPro\IntegrationCore\Infrastructure\Configuration\Configuration;
19+
use Packlink\PacklinkPro\IntegrationCore\Infrastructure\ServiceRegister;
20+
use Packlink\PacklinkPro\IntegrationCore\Infrastructure\TaskExecution\Interfaces\TaskRunnerWakeup;
1921

2022
/**
2123
* Class Dashboard
@@ -75,6 +77,8 @@ public function __construct(
7577
*/
7678
public function execute()
7779
{
80+
$this->wakeUp();
81+
7882
$user = $this->authSession->getUser();
7983

8084
if ($user) {
@@ -193,4 +197,14 @@ private function getCurrentTranslations()
193197

194198
return json_decode(file_get_contents($baseDir . $locale . '.json'), true);
195199
}
200+
201+
/**
202+
* Task runner wakeup.
203+
*/
204+
private function wakeUp()
205+
{
206+
/** @var TaskRunnerWakeup $taskRunnerWakeupService */
207+
$taskRunnerWakeupService = ServiceRegister::getService(TaskRunnerWakeup::CLASS_NAME);
208+
$taskRunnerWakeupService->wakeup();
209+
}
196210
}

PacklinkPro/Setup/UpgradeSchema.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
7979
}
8080

8181
if (version_compare($context->getVersion(), '1.2.0', '<')) {
82-
$this->upgradeTo120($setup);
82+
$this->upgradeTo120($setup, $context);
8383
}
8484
}
8585

@@ -171,8 +171,6 @@ protected function upgradeTo110(SchemaSetupInterface $setup)
171171
Logger::logInfo('Update script V1.1.0 has been successfully completed.');
172172
} catch (\Exception $e) {
173173
Logger::logError("V1.1.0 update script failed because: {$e->getMessage()}");
174-
175-
throw $e;
176174
}
177175
}
178176

@@ -200,17 +198,23 @@ protected function upgradeTo114(SchemaSetupInterface $setup)
200198
* Runs the upgrade script for v1.2.0.
201199
*
202200
* @param SchemaSetupInterface $setup
201+
* @param \Magento\Framework\Setup\ModuleContextInterface $context
203202
*
204-
* @throws \Exception
203+
* @throws \Packlink\PacklinkPro\IntegrationCore\Infrastructure\ORM\Exceptions\RepositoryNotRegisteredException
204+
* @throws \Packlink\PacklinkPro\IntegrationCore\Infrastructure\TaskExecution\Exceptions\QueueStorageUnavailableException
205205
*/
206-
protected function upgradeTo120(SchemaSetupInterface $setup)
206+
protected function upgradeTo120(SchemaSetupInterface $setup, ModuleContextInterface $context)
207207
{
208208
Logger::logInfo('Started executing V1.2.0 update script.');
209209

210-
$this->updateShippingMethods($setup);
211-
212210
$this->convertParcelProperties($setup);
213211

212+
if (version_compare($context->getVersion(), '1.1.0', '<')) {
213+
$this->updateShippingServices();
214+
}
215+
216+
$this->updateShippingMethods($setup);
217+
214218
Logger::logInfo('Update script V1.2.0 has been successfully completed.');
215219
}
216220

0 commit comments

Comments
 (0)