Skip to content

Commit

Permalink
feat: Explicitly exit the process to not wait for hanging promises (#51)
Browse files Browse the repository at this point in the history
* 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: ruby/setup-ruby#543 (comment)

The fix, as with other actions, is to explicitly exit so as not to wait for hanging promises.

* transpiled
  • Loading branch information
kamatsuoka authored Mar 22, 2024
1 parent 327261f commit 7d10bd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions dist/setup-pdm.js
Original file line number Diff line number Diff line change
Expand Up @@ -91128,6 +91128,7 @@ async function run() {
} catch (error2) {
core8.setFailed(error2.message);
}
import_node_process4.default.exit();
}
run();
/*! Bundled license information:
Expand Down
3 changes: 3 additions & 0 deletions src/setup-pdm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ async function run(): Promise<void> {
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()

0 comments on commit 7d10bd0

Please sign in to comment.