tiffany352 / rink-rs

Unit conversion tool and library written in rust

Home Page:https://rinkcalc.app/about

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fetch of currency data delays start by several seconds

tdaede opened this issue · comments

It would be nice to lazily update currency info in the background.

I'd like to note a finding with today's Cloudflare hiccup: rink will not launch while there is no internet connection (or at least no DNS resolution).

Yep, I hit that regularly.

I changed the timeout to 2 seconds and made it so that it will attempt to reuse the existing cached file if the request fails. I hope that will fix the issue, although the eventual solution would definitely be to fetch it in the background asynchronously.

I had a bit of trouble testing it though, so let me know if you run into any issues. This is included in the 0.5 release.

Thank you, works well for me!

I was having issues with currency fetching timing out after 2 seconds or otherwise taking over a second to complete. The server also went down sometimes for seemingly no reason.

rinkcalc.app is now behind a CDN which should help a lot, especially in countries with bad peering to the US. Requests for currency.json now consistently take less than 100ms for me but I live relatively close to one of their POPs.

This ticket will stay open. I really want to make currency fetching only happen when you actually go to use currency units, rather than blocking startup.

Nice! Thank you @tiffany352, I kept hitting this every once in a while. Rink is so core to my workflow these days that I just lived with it, but it was a little annoying.