From 488c25c271981a87efe3c7a19bb5d72073864506 Mon Sep 17 00:00:00 2001 From: Kenji Matsuoka Date: Wed, 20 Mar 2024 12:00:25 -0700 Subject: [PATCH 1/2] 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. --- src/setup-pdm.ts | 3 +++ 1 file changed, 3 insertions(+) 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() From f2ca855f6cbac0ad4f1dfa6d6fdc66a51634c455 Mon Sep 17 00:00:00 2001 From: Kenji Matsuoka Date: Thu, 21 Mar 2024 10:33:22 -0700 Subject: [PATCH 2/2] transpiled --- dist/setup-pdm.js | 1 + 1 file changed, 1 insertion(+) 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: