mirror of
https://github.com/gradle/actions.git
synced 2026-03-25 13:36:20 +08:00
Avoid windows shutdown bug (#900)
* Avoid windows shutdown bug with shutdown delay * Use a separate concurrency group for integ-test-full
This commit is contained in:
14
sources/src/force-exit.ts
Normal file
14
sources/src/force-exit.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
const WINDOWS_EXIT_DELAY_MS = 50
|
||||
|
||||
export function getForcedExitDelayMs(platform: NodeJS.Platform = process.platform): number {
|
||||
return platform === 'win32' ? WINDOWS_EXIT_DELAY_MS : 0
|
||||
}
|
||||
|
||||
export async function forceExit(platform: NodeJS.Platform = process.platform): Promise<never> {
|
||||
const exitDelayMs = getForcedExitDelayMs(platform)
|
||||
if (exitDelayMs > 0) {
|
||||
await new Promise(resolve => setTimeout(resolve, exitDelayMs))
|
||||
}
|
||||
|
||||
return process.exit()
|
||||
}
|
||||
Reference in New Issue
Block a user