From 7d10bd0f83c65b52c206973185cc64d2e2c63499 Mon Sep 17 00:00:00 2001 From: Kenji Matsuoka Date: Thu, 21 Mar 2024 19:41:40 -0700 Subject: [PATCH] feat: Explicitly exit the process to not wait for hanging promises (#51) * Explicitly exit the process to not wait for hanging promises As with other actions like setup-node, I'm seeing 2-4 minute delays in post cache actions lately. Apparently this is because of a change in node behavior: https://github.com/ruby/setup-ruby/issues/543#issuecomment-1793608370 The fix, as with other actions, is to explicitly exit so as not to wait for hanging promises. * transpiled --- dist/setup-pdm.js | 1 + src/setup-pdm.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dist/setup-pdm.js b/dist/setup-pdm.js index 178f70d..90b86a1 100644 --- a/dist/setup-pdm.js +++ b/dist/setup-pdm.js @@ -91128,6 +91128,7 @@ async function run() { } catch (error2) { core8.setFailed(error2.message); } + import_node_process4.default.exit(); } run(); /*! Bundled license information: diff --git a/src/setup-pdm.ts b/src/setup-pdm.ts index df219b8..6f5d301 100644 --- a/src/setup-pdm.ts +++ b/src/setup-pdm.ts @@ -67,6 +67,9 @@ async function run(): Promise { catch (error: any) { core.setFailed(error.message) } + // Explicit process.exit() to not wait for hanging promises, + // see https://github.com/actions/setup-node/issues/878 + process.exit() } run()