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

create cache directory if it doesn't exist #54

Merged
merged 1 commit into from
Dec 18, 2024
Merged

Conversation

garmr-ulfr
Copy link
Contributor

@garmr-ulfr garmr-ulfr commented Dec 17, 2024

This replaces this PR.

Comment on lines -18 to -19
// This is not a big deal since we'll just fill the cache later
log.Debugf("ignorable error: Unable to read cache file for prepopulation: %v", err)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this is ignorable. By this point if it can't read the file it won't be able to write to it later.

Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't really true, as it just means no cache file has been created yet. That will be true every time on the first run, for example.

Copy link
Contributor Author

@garmr-ulfr garmr-ulfr Dec 18, 2024

Choose a reason for hiding this comment

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

By this point if it can't read the file it won't be able to write to it later.

Sorry, by this I meant after including the change to create the parent directory.

However, even before this, while unlikely, it could still fail if it doesn't have read/write permissions on the directory.

@coveralls
Copy link

Coverage Status

coverage: 85.0% (+1.1%) from 83.892%
when pulling 8eba9cf on create-cache-dir
into a55b6db on main.

@jigar-f
Copy link
Contributor

jigar-f commented Dec 18, 2024

@garmr-ulfr Changes are working for me, merging.

@jigar-f jigar-f merged commit 4db2538 into main Dec 18, 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.

4 participants