build(dashboard): implement caching for dashboard downloads#60
Open
Cleboost wants to merge 6 commits into
Open
build(dashboard): implement caching for dashboard downloads#60Cleboost wants to merge 6 commits into
Cleboost wants to merge 6 commits into
Conversation
| for i in 0..archive.len() { | ||
| let mut file = archive.by_index(i)?; | ||
| let outpath = dest_dir.join(file.mangled_name()?); | ||
| let client = reqwest::blocking::Client::new(); |
Collaborator
There was a problem hiding this comment.
Can you add a timeout please ?
| fs::remove_dir_all(&dest_dir)?; | ||
| } | ||
| // 2. Check cache age to avoid downloading on every single compile. | ||
| let force_download = env::var("TEMPER_FORCE_DASHBOARD_DOWNLOAD").is_ok(); |
Collaborator
There was a problem hiding this comment.
Can you follow the convention and do something like that :
env::var("TEMPER_FORCE_DASHBOARD_DOWNLOAD").map(|v| v == "1").unwrap_or(false)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request improves the build process for the dashboard by introducing a caching mechanism to avoid unnecessary downloads. The build script now checks the age of the cached dashboard and only downloads a new copy if the cache is older than 24 hours or if explicitly forced by an environment variable. This should speed up builds and reduce redundant network usage.
Dashboard download caching:
index.htmlfile and only download the dashboard if it is older than 24 hours.TEMPER_FORCE_DASHBOARD_DOWNLOADenvironment variable to force a dashboard download regardless of cache age. [1] [2]Other improvements:
std::time::SystemTimeimport to support cache age checking.fix #29