Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I use lots of short invocations of numbat with
fetching-policy = "on-first-use"
which means it re-fetches the rates every time I open it to do a quick currency conversion. Theon-startup
fetching policy makes it a bit better, but the delay is still noticeable if the first thing I do uses currency, and it just feels wasteful to download them every time when they're only updated daily. This change reuses the fetched rates for 24 hours to alleviate that delay.This could make the rates up to a day out of date (if you happened to fetch them the first time right before the European Central Bank releases the next day's rates). In my mind this isn't hugely important as anyone who needs super up-to-date rates is probably using a different source in the first place, but the max age could be changed to something shorter to make it fetch more aggressively. If users want even more control,
max-age
could be specified as a config option in the[exchange-rates]
section.