-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: Add caching for remote socket fetch with configurable TTL #17
Conversation
Hi @fmich7, Thank you for this! Overall it is looking good. I appreciate the refactor as well. I have added comments prefixed with I found one legitimate issue where the sockets are loaded from cache even when the I agree about the configuration variables. I was thinking we could just pass around a pointer to the |
808bfbe
to
9b70f8d
Compare
Hey @Tackx, I went through your feedback and fixed the issues you pointed out. I also updated the documentation and tested the entire package. Coverage is around Additionally, I added a
I am on board with that approach. It will make the codebase a lot easier to understand and expand. Let me know what you think. |
86c56e1
to
eaa45eb
Compare
β¦nux filepaths, unable to delete temp files, reader not being closed), Refactor For the windows-specific issues, see golang/go#50510
Hi @fmich7, It looks very solid now, thank you! I've played around with our remote API endpoint and the cache and it seems to be doing what it should. The biggest issues I ran into were Windows-specific and only relevant to tests (see the list below). I was able to fix the issues and tests run properly on my machine as well. I have mostly made just semantic changes and nitpicky corrections with a few small exceptions:
I think it is good to merge now, so thank you very much again for your help! If you would like to help with refactoring the config variables to a pointer to the FYI @krustowski |
Hi @Tackx, Thank you so much for such detailed feedback. I really appreciate it! The changes you made make sense. Overall, I missed a few things while working on this PR, but your feedback really helped me understand what to watch out for next time, so thanks again!
Yes, I would be happy to help with refactoring, feel free to open an issue. |
Hi @Tackx ππ»ββοΈ
This PR adds caching for remote socket fetches, addressing this task (dish should cache remote socket list to some file #3).
What I did
cache
Enables cachingcacheDir=[string]
Specify the directory where cached files are storedcacheTTL=[uint]
Set the cache expiration time in minutestesthelpers
packagesockets
package (also with caching)To-do
README.md
Also, you might consider changing the way configuration variables are passed in this project. It's inconvenient to pass that many variables to functions.
Please review and provide feedback for this PR so I can make any necessary improvements.