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

fix: clear dep analysis when module loading is done #27204

Merged
merged 11 commits into from
Dec 5, 2024
3 changes: 3 additions & 0 deletions cli/module_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ impl InFlightModuleLoadsTracker {
let parsed_source_cache = parsed_source_cache.clone();
let timeout = self.cleanup_task_timeout;
let task_handle = tokio::spawn(async move {
// NB(bartlomieju): we use a timeout here, which is defined to 10s,
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: I feel like we don't have to add attribution to comments like this. It's already in the git blame.

Copy link
Member Author

@bartlomieju bartlomieju Dec 4, 2024

Choose a reason for hiding this comment

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

I removed it, but it only works as long as this code is not moved between files. Then it becomes easy to have a really hard time tracking who wrote the comment.

// so that in situations when dynamic imports are loaded after the startup,
// we don't need to recompute and analyze multiple modules.
tokio::time::sleep(std::time::Duration::from_millis(timeout)).await;
bartlomieju marked this conversation as resolved.
Show resolved Hide resolved
parsed_source_cache.free_all();
});
Expand Down
Loading