Skip to content
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

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

StanChe
Copy link
Collaborator

@StanChe StanChe commented Jan 24, 2025

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.

Copy link
Contributor

@armyhaylenko armyhaylenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LBTM

interface/src/json.rs Outdated Show resolved Hide resolved
@StanChe StanChe force-pushed the feature/MTG-1258-turn-off-re-download branch from 3687393 to 44de970 Compare January 24, 2025 15:41
@@ -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);
Copy link
Contributor

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();
Copy link
Contributor

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.

Copy link
Collaborator Author

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

@StanChe StanChe merged commit 4ee5691 into main Jan 24, 2025
2 checks passed
@StanChe StanChe deleted the feature/MTG-1258-turn-off-re-download branch January 24, 2025 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants