Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cache restoration logic to use Promise.allSettled for better error handling #952

Merged
merged 1 commit into from
Mar 16, 2025

Conversation

smorimoto
Copy link
Member

Closes #951

…ror handling

Signed-off-by: Sora Morimoto <sora@morimoto.io>
@smorimoto smorimoto added the bug Something isn't working label Mar 16, 2025
@smorimoto smorimoto requested a review from Copilot March 16, 2025 20:54

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves cache restoration by switching from Promise.all to Promise.allSettled for better error handling in both opam and cygwin caches.

  • Replaces Promise.all with Promise.allSettled to prevent failures in one cache from affecting the other.
  • Unpacks settled promise results into opam and cygwin cache hit values.
Comments suppressed due to low confidence (1)

packages/setup-ocaml/src/cache.ts:172

  • [nitpick] Consider renaming the variables to opamCacheResult and cygwinCacheResult to clearly indicate that these values are the outcomes of Promise.allSettled, which are then subsequently unpacked into cache hit values.
const [opamCache, cygwinCache] = await Promise.allSettled(
@smorimoto smorimoto merged commit bf8b6e8 into master Mar 16, 2025
18 checks passed
@smorimoto smorimoto deleted the cache-better-error-handle branch March 16, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UncaughtException from some timeout makes CI jobs fail
1 participant