Add an upload timeout of 60 minutes (#171)
* Add an upload timeout of 60 minutes * Remove now defunct tests
This commit is contained in:
36
src/main.ts
36
src/main.ts
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user