Add an upload timeout of 60 minutes (#171)

* Add an upload timeout of 60 minutes

* Remove now defunct tests
This commit is contained in:
Jack Boswell
2023-02-10 22:59:20 +13:00
committed by GitHub
parent 02c72d76fe
commit 9a5e7fcdd5
5 changed files with 146 additions and 264 deletions

View File

@@ -65,19 +65,22 @@ export async function run() {
core.warning(`Unable to find 'debugSymbols' @ ${debugSymbols}`);
}
await runUpload(
packageName,
track,
inAppUpdatePriorityInt,
userFractionFloat,
whatsNewDir,
mappingFile,
debugSymbols,
releaseName,
changesNotSentForReview,
existingEditId,
status,
validatedReleaseFiles
await withTimeout(
3.6e+6, // 60 minute timeout
runUpload(
packageName,
track,
inAppUpdatePriorityInt,
userFractionFloat,
whatsNewDir,
mappingFile,
debugSymbols,
releaseName,
changesNotSentForReview,
existingEditId,
status,
validatedReleaseFiles
)
)
} catch (error: unknown) {
if (error instanceof Error) {
@@ -116,4 +119,11 @@ async function validateServiceAccountJson(serviceAccountJsonRaw: string | undefi
}
}
async function withTimeout<T>(timeoutMillis: number, promise: Promise<T>): Promise<T> {
return Promise.race([
new Promise<never>((_, reject) => setTimeout(reject, timeoutMillis)),
promise
])
}
void run();