tiffany352 / rink-rs

Unit conversion tool and library written in rust
https://rinkcalc.app/about
GNU General Public License v3.0
441 stars 28 forks source link

Manually invoked currency refresh #181

Closed tiffany352 closed 4 months ago

tiffany352 commented 4 months ago

Adds currency.fetch_on_startup to the config, which when set to false behaves as if the cache_duration was infinite. This means rink will fetch the file once, and then keep reusing that file indefinitely.

Adds a --fetch-currency CLI argument, which will make rink download the latest version of the currency data and then exit. This can be put into a cron job and used together with the config option so that rink will never block on a web request at startup, without giving up currency units. Requires manual setup though.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 90.12346% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 81.63%. Comparing base (6e674f0) to head (4dba69d).

Files Patch % Lines
cli/src/config.rs 90.12% 16 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #181 +/- ## ========================================== + Coverage 80.81% 81.63% +0.82% ========================================== Files 42 42 Lines 7718 7870 +152 ========================================== + Hits 6237 6425 +188 + Misses 1481 1445 -36 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.