diff --git a/CHANGELOG.md b/CHANGELOG.md index 6284c3dd9..3d556d2e7 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE + [#749](https://github.com/luyadev/luya-module-admin/pull/749) Added a new property, `luya\admin\Module::$apiUserTrackLastActivity`, which controls the update of the last activity timestamp for API users. By default, this feature is enabled to maintain backward compatibility. For larger systems, disabling this property can prevent unnecessary database writes. + [#751](https://github.com/luyadev/luya-module-admin/pull/751) Fixed parameter placeholders in translations (hu, nl, pl). + [#752](https://github.com/luyadev/luya-module-admin/pull/752) Updated links to new guide. ++ [#753](https://github.com/luyadev/luya-module-admin/pull/753) Enhanced error handling for scenarios where the proxy command attempts to synchronize a non-existent file. ## 5.0.0 (30. November 2023) diff --git a/src/proxy/ClientTransfer.php b/src/proxy/ClientTransfer.php index 7380d4d01..062e4a4fe 100644 --- a/src/proxy/ClientTransfer.php +++ b/src/proxy/ClientTransfer.php @@ -112,26 +112,30 @@ protected function startImages() $imageCount = 0; // sync images foreach ((new \luya\admin\image\Query())->all() as $image) { - /** @var Item $image */ - if (!$image->fileExists) { - $curl = new Curl(); - $curl->setOpt(CURLOPT_RETURNTRANSFER, true); - $curl->get($this->build->imageProviderUrl, [ - 'buildToken' => $this->build->buildToken, - 'machine' => $this->build->machineIdentifier, - 'imageId' => $image->id, - ]); - - if (!$curl->error) { - if ($this->storageUpload($image->systemFileName, $curl->response)) { - $imageCount++; - $this->build->command->outputInfo('[+] Image ' . $image->source.' downloaded.'); + try { + /** @var Item $image */ + if (!$image->fileExists) { + $curl = new Curl(); + $curl->setOpt(CURLOPT_RETURNTRANSFER, true); + $curl->get($this->build->imageProviderUrl, [ + 'buildToken' => $this->build->buildToken, + 'machine' => $this->build->machineIdentifier, + 'imageId' => $image->id, + ]); + + if (!$curl->error) { + if ($this->storageUpload($image->systemFileName, $curl->response)) { + $imageCount++; + $this->build->command->outputInfo('[+] Image ' . $image->source.' downloaded.'); + } } - } - $curl->close(); - unset($curl); - gc_collect_cycles(); + $curl->close(); + unset($curl); + gc_collect_cycles(); + } + } catch (Exception $e) { + $this->build->command->outputError('[!] Unable to download image due to error: ' . $e->getMessage()); } }