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

refactor: cache handling and improve cache action logs #46

Merged
merged 2 commits into from
Feb 19, 2024

Conversation

penandlim
Copy link
Contributor

Cache was not saving on some of my actions with cache input not explicitly set - moving the check of cache input into js seems to have fixed it.

  • Refactor cache handling and improve cache action logs
  • Use getBooleanInput to ensure boolean type
  • Add helpful logging similar to actions/setup-* repos to see which cache was restored/saved.
  • Add early exit on post-action for a workaround. With a 200kb cache, post-action time is decreased from 2min~ -> 2 seconds.

Comment on lines +30 to +31
if (cacheId === -1) {
return;
Copy link
Member

Choose a reason for hiding this comment

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

when does this happen? should we add a log?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like it happens when there is an existing cache with the primary key thus fails saving the cache.
It doesn't throw an error and prints a message like this before returning with -1.

Failed to save: Unable to reserve cache with key linux-foundry-chain-fork-c2ec5babbad85fecbae9c860472722f98f36c164, another job may be creating this cache. More details: Cache already exists. Scope: refs/heads/master, Key: linux-foundry-chain-fork-c2ec5babbad85fecbae9c860472722f98f36c164, Version: d8cfedd31e23b815ad861b2e68523a31664eaf28c2ddc7b682eb115646a473d9

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

thank you

@onbjerg onbjerg merged commit 362aa1b into foundry-rs:master Feb 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants