summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 578ea6846..ac0d2f591 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -76,7 +76,6 @@ use deno_runtime::worker::MainWorker;
use deno_runtime::worker::WorkerOptions;
use log::Level;
use log::LevelFilter;
-use std::cell::RefCell;
use std::env;
use std::io::Read;
use std::io::Write;
@@ -85,6 +84,7 @@ use std::path::PathBuf;
use std::pin::Pin;
use std::rc::Rc;
use std::sync::Arc;
+use std::sync::Mutex;
fn create_web_worker_callback(
program_state: Arc<ProgramState>,
@@ -349,7 +349,7 @@ async fn info_command(
let program_state = ProgramState::new(flags)?;
if let Some(specifier) = maybe_specifier {
let specifier = ModuleSpecifier::resolve_url_or_path(&specifier)?;
- let handler = Rc::new(RefCell::new(specifier_handler::FetchHandler::new(
+ let handler = Arc::new(Mutex::new(specifier_handler::FetchHandler::new(
&program_state,
// info accesses dynamically imported modules just for their information
// so we allow access to all of them.
@@ -497,7 +497,7 @@ async fn create_module_graph_and_maybe_check(
program_state: Arc<ProgramState>,
debug: bool,
) -> Result<module_graph::Graph, AnyError> {
- let handler = Rc::new(RefCell::new(FetchHandler::new(
+ let handler = Arc::new(Mutex::new(FetchHandler::new(
&program_state,
// when bundling, dynamic imports are only access for their type safety,
// therefore we will allow the graph to access any module.
@@ -850,7 +850,7 @@ async fn run_with_watch(flags: Flags, script: String) -> Result<(), AnyError> {
async move {
let main_module = ModuleSpecifier::resolve_url_or_path(&script1)?;
let program_state = ProgramState::new(flags)?;
- let handler = Rc::new(RefCell::new(FetchHandler::new(
+ let handler = Arc::new(Mutex::new(FetchHandler::new(
&program_state,
Permissions::allow_all(),
)?));