-
Notifications
You must be signed in to change notification settings - Fork 7
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
[MTG-1258] an option to turn off the json re-download, enabled by default #384
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LBTM
3687393
to
44de970
Compare
@@ -27,12 +27,13 @@ use crate::api::dapi::rpc_asset_convertors::parse_files; | |||
pub const JSON_BATCH: usize = 300; | |||
pub const WIPE_PERIOD_SEC: u64 = 60; | |||
pub const SLEEP_TIME: u64 = 1; | |||
pub const CLIENT_TIMEOUT: u64 = 5; | |||
pub const CLIENT_TIMEOUT: Duration = Duration::from_secs(30); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it makes sense to make this variable configurable throw the env?
@@ -267,7 +269,8 @@ pub async fn get_by_ids< | |||
let json_downloader = json_downloader.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if instead of skipping the update we just make the whole update process as an asynchronous process in the background.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'll be a bigger story with the refresh queue. This one is a rather hot fix to deploy today and make live on Monday
As a short-term solution for longer requests we disable the cache invalidation alongside the request.
Also we separate the inline json download timeout from the main workers timeout, letting workers wait for 30 seconds for the response, while the inline download is restricted to 3 seconds.