From 9b71657bb2108f93ff15730273612ccff76d6b77 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Sat, 23 Nov 2024 11:58:21 +0100 Subject: [PATCH] Add comment to clarify process.exit(0) (#161) Copied from https://github.com/actions/cache/pull/1217 --- dist/save-cache/index.js | 5 +++++ src/save-cache.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/dist/save-cache/index.js b/dist/save-cache/index.js index 13846ca..7f546d4 100644 --- a/dist/save-cache/index.js +++ b/dist/save-cache/index.js @@ -82523,6 +82523,11 @@ function run() { const err = error; core.setFailed(err.message); } + // node will stay alive if any promises are not resolved, + // which is a possibility if HTTP requests are dangling + // due to retries or timeouts. We know that if we got here + // that all promises that we care about have successfully + // resolved, so simply exit with success. process.exit(0); }); } diff --git a/src/save-cache.ts b/src/save-cache.ts index 173c4ba..cf5acca 100644 --- a/src/save-cache.ts +++ b/src/save-cache.ts @@ -20,6 +20,11 @@ export async function run(): Promise { const err = error as Error; core.setFailed(err.message); } + // node will stay alive if any promises are not resolved, + // which is a possibility if HTTP requests are dangling + // due to retries or timeouts. We know that if we got here + // that all promises that we care about have successfully + // resolved, so simply exit with success. process.exit(0); }