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

Updated the cache_get method to use the with block #2020

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from

Conversation

noob6t5
Copy link

@noob6t5 noob6t5 commented Nov 23, 2024

In this PR ,
To properly handle file operations and ensure that the file is closed after it's no longer needed, you can use a with block. I have updated code that automatically handle closing the file when the block of code is finished, preventing resource leaks.

else:
log.debug(f'Cached content for "{key}" is older than {cache_hrs:,} hours')

return None
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

thanks for enlightenment 😀

@noob6t5
Copy link
Author

noob6t5 commented Nov 24, 2024

Can we merge this?

@cclauss
Copy link
Contributor

cclauss commented Nov 24, 2024

Merge it with failing tests?

@noob6t5
Copy link
Author

noob6t5 commented Nov 24, 2024

What am I missing after making changes?
All my PR is failed
I'll switch to my device RN to take a look

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