-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Added support for caching results #97
Added support for caching results #97
Conversation
hello, thank you for your pr! I will take a look when I have time, hopefully before the end of next week. |
Thanks, Hedy. Glad to hear back from you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There are some minor improvements that could be made, but since I might not be able to review them quickly after your response, I will do them myself. Thanks again!
|
||
from datetime import datetime, timedelta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be with the other standard library imports
@@ -12,6 +15,8 @@ | |||
status_actions, | |||
) | |||
|
|||
CACHED_RESULT_FP = os.path.dirname(os.path.dirname(__file__)) + "/.cached_result.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think FP is a good constant name, how about:
CACHED_RESULT_FP = os.path.dirname(os.path.dirname(__file__)) + "/.cached_result.json" | |
CACHED_RESULT_PATH = os.path.dirname(os.path.dirname(__file__)) + "/.cached_result.json" |
@allcontributors please add @AkashD-Developer for code |
@hedythedev I've put up a pull request to add @AkashD-Developer! 🎉 |
Hey Hedy, thank you so much. I would love to contribute more if there’s anything else you require help for. |
No problem, feel free to do the tests ^ |
Hey @hedythedev, sure I will take up the new issue. I was actually thinking of some tests for it but was unable to come up with anything. Thanks for the ideas 👍 |
Checklist
Description
Resolves #61
Added support to cache the responses to a JSON file which will get created when the user first runs the program and also added it to .gitignore so that it will not be tracked by git.
The cache file looks something like this after few requests
Those are the keys, which contains the content of the responses.