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

always create cache dir when missing #97

Merged
merged 2 commits into from
Jan 31, 2024
Merged

always create cache dir when missing #97

merged 2 commits into from
Jan 31, 2024

Conversation

bbonf
Copy link

@bbonf bbonf commented Jan 24, 2024

This is supposed to fix a bug that was encountered on the server when the cache folder is missing.
I think it's ok to always run Path.mkdir(exist_ok=True, parents=True)

@@ -76,7 +70,7 @@ def check_results(self) -> bool:

def get_results(self) -> ResultSet:
"""Return results as a dict"""
cache_filename = str(self._get_cache_path(False))
cache_filename = str(self._get_cache_path())

Choose a reason for hiding this comment

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

Good of course, but those lines can be shortened to results = self._get_cache_path().read_text().

Copy link
Author

Choose a reason for hiding this comment

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

cool, I didn't know about .read_text()

@bbonf bbonf merged commit ace4840 into main Jan 31, 2024
1 check passed
@bbonf bbonf deleted the fix/missing-cache-dir branch January 31, 2024 08:59
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