Skip to content

Commit

Permalink
Merge pull request #291 from vtsykun/fix/integration-download
Browse files Browse the repository at this point in the history
Use dist http download always if api perf enabled to support LFS
  • Loading branch information
vtsykun authored Nov 2, 2024
2 parents 8a5e0c1 + df3cd1f commit 24a854e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Service/DistManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Packeton\Entity\Package;
use Packeton\Entity\Version;
use Packeton\Integrations\IntegrationRegistry;
use Packeton\Integrations\Model\AppUtils;
use Packeton\Integrations\ZipballInterface;
use Packeton\Model\UploadZipballStorage;
use Packeton\Model\VirtualPackageManager;
Expand Down Expand Up @@ -106,15 +107,18 @@ public function downloadUsingIntegration(string $reference, Package $package, ?s
$fileName = $this->config->getFileName($reference, $versionName);
$format = $this->config->getArchiveFormat();

$client = $this->integrations->get($oauth->getAlias());

try {
if ($path = $archiveManager->tryFromGitArchive($reference, $format, $targetDir, $fileName)) {
if (false === AppUtils::useApiPref($client->getConfig(), $oauth)
&& null !== ($path = $archiveManager->tryFromGitArchive($reference, $format, $targetDir, $fileName))
) {
return $path;
}
} catch (\Throwable $e) {
// Try from ref
}

$client = $this->integrations->get($oauth->getAlias());
if ($client instanceof ZipballInterface) {
return $client->zipballDownload($oauth, $package->getExternalRef(), $reference, $targetPath);
}
Expand Down

0 comments on commit 24a854e

Please sign in to comment.