Skip to content

Commit 598f6d5

Browse files
committed
keep retrying more
1 parent a77e49c commit 598f6d5

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/SPC/builder/unix/UnixBuilderBase.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,19 @@ protected function buildFrankenphp(): void
268268
logger()->warning('caddy-cbrotli module is enabled, but brotli library is not built. Disabling caddy-cbrotli.');
269269
$xcaddyModules = str_replace('--with github.com/dunglas/caddy-cbrotli', '', $xcaddyModules);
270270
}
271-
$releaseInfo = json_decode(Downloader::curlExec(
272-
'https://api.github.com/repos/php/frankenphp/releases/latest',
273-
hooks: [[CurlHook::class, 'setupGithubToken']],
274-
retries: 3,
275-
), true);
271+
$releaseInfo = false;
272+
$retries = 5;
273+
while (!$releaseInfo && --$retries >= 0) {
274+
try {
275+
$releaseInfo = json_decode(Downloader::curlExec(
276+
'https://api.github.com/repos/php/frankenphp/releases/latest',
277+
hooks: [[CurlHook::class, 'setupGithubToken']],
278+
retries: 3,
279+
), true, 512, JSON_THROW_ON_ERROR);
280+
} catch (\Exception) {
281+
sleep(1);
282+
}
283+
}
276284
$frankenPhpVersion = $releaseInfo['tag_name'];
277285
$libphpVersion = $this->getPHPVersion();
278286
$dynamic_exports = '';

0 commit comments

Comments
 (0)