retry every 10s

This commit is contained in:
Henri Maurer
2023-06-07 16:39:16 +01:00
parent cff142b535
commit 9dde5949a8
+9 -8
View File
@@ -29,26 +29,27 @@ async function run(): Promise<void> {
let changes let changes
let snapshot_warnings let snapshot_warnings
for (let i = 0; i < 60 * 5; i++) { let i = 0
while (true) {
const comparison = await dependencyGraph.compare({ const comparison = await dependencyGraph.compare({
owner: github.context.repo.owner, owner: github.context.repo.owner,
repo: github.context.repo.repo, repo: github.context.repo.repo,
baseRef: refs.base, baseRef: refs.base,
headRef: refs.head headRef: refs.head
}) })
if ( if (i >= 12) {
comparison.snapshot_warnings.match( core.setFailed('Exhausted retries. Exiting.')
/No snapshots were found for the head SHA/i return
) } else if (comparison.snapshot_warnings.trim() != '') {
) {
core.info(comparison.snapshot_warnings) core.info(comparison.snapshot_warnings)
core.info('Retrying in 1 second...') core.info('Retrying in 10 seconds...')
await delay(1000) await delay(10000)
} else { } else {
changes = comparison.changes changes = comparison.changes
snapshot_warnings = comparison.snapshot_warnings snapshot_warnings = comparison.snapshot_warnings
break break
} }
i++
} }
if (!changes) { if (!changes) {