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

Expire cache periodically to avoid unbounded size #466

Merged
merged 2 commits into from May 11, 2022
Merged

Expire cache periodically to avoid unbounded size #466

merged 2 commits into from May 11, 2022

Conversation

ezimanyi
Copy link
Contributor

@ezimanyi ezimanyi commented May 7, 2022

The cache key includes a sequence number that rotates every 7 days but because we are also using the base golangci-lint.cache as a restore key, the new cache will always be seeded with the full contents of the old cache.

In particular for the go module cache, this leads to an ever increasing number of cached packages that never get pruned.

This commit updates it so we stop using golangci-lint.cache as a restore key, which will force a build from an empty cache once every 7 days.

Fixes #465

@ldez ldez added the enhancement New feature or request label May 7, 2022
The cache key includes a sequence number that rotates every 7 days
but because we are also using the base `golangci-lint.cache` as a
restore key, the new cache will always be seeded with the full
contents of the old cache.

In particular for the go module cache, this leads to an ever
increasing number of cached packages that never get pruned.

This commit updates it so we stop using `golangci-lint.cache` as
a restore key, which will force a build from an empty cache once
every 7 days.
Copy link
Member

@SVilgelm SVilgelm 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 for the investigation and the PR. LGTM

@SVilgelm SVilgelm merged commit 537aa19 into golangci:master May 11, 2022
@SVilgelm
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Size of github actions cache continually increasing
3 participants