-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add caching with expiry to the cache package
Why? Each request to yr.no comes with an expiry time. We should not ask for the same forecast again if the first one is not expired. How? Extend the cache package to use PutWithTTL to the database. This will save an object. When we ask to retrieve that object, if it is expired it will throw a KeyExpired error. In order to allow this to happen, we need to change the cache implementation to pass through the errors which are returned from bitcask. Currently all of the logic is inside the command function. Ideally, this could be split out into a package.
- Loading branch information
CiaraTully
committed
Apr 1, 2024
1 parent
11e21d9
commit 04f4217
Showing
5 changed files
with
97 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters