diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-11-22 18:46:57 +0100 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-11-22 12:46:57 -0500 |
commit | c6bb3d5a10ba8acceadcaa66050abcaefb7bc0bb (patch) | |
tree | e60f007215fc0f146db4457db85eda8f4716d314 /cli/compilers/ts.rs | |
parent | 363b968bfcef26c30f84e485beec6194e5b1dd98 (diff) |
remove tokio_util::block_on (#3388)
This PR removes tokio_util::block_on - refactored compiler and file
fetcher slightly so that we can safely block there - that's because
only blocking path consist of only synchronous operations.
Additionally I removed excessive use of tokio_util::panic_on_error
and tokio_util::run_in_task and moved both functions to cli/worker.rs,
to tests module.
Closes #2960
Diffstat (limited to 'cli/compilers/ts.rs')
-rw-r--r-- | cli/compilers/ts.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cli/compilers/ts.rs b/cli/compilers/ts.rs index c255e18be..ff5405f52 100644 --- a/cli/compilers/ts.rs +++ b/cli/compilers/ts.rs @@ -473,7 +473,7 @@ impl TsCompiler { let source_file = self .file_fetcher - .fetch_source_file(&module_specifier) + .fetch_cached_source_file(&module_specifier) .expect("Source file not found"); let version_hash = source_code_version_hash( @@ -581,10 +581,9 @@ impl TsCompiler { script_name: &str, ) -> Option<SourceFile> { if let Some(module_specifier) = self.try_to_resolve(script_name) { - return match self.file_fetcher.fetch_source_file(&module_specifier) { - Ok(out) => Some(out), - Err(_) => None, - }; + return self + .file_fetcher + .fetch_cached_source_file(&module_specifier); } None |