Skip to content

Commit 46bc316

Browse files
committed
Revert "fix: add configure logging and move glob expansion outside write lock"
This reverts commit 5beccc3.
1 parent 5beccc3 commit 46bc316

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

crates/pet/src/jsonrpc.rs

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -115,35 +115,23 @@ pub fn handle_configure(context: Arc<Context>, id: u32, params: Value) {
115115
Ok(configure_options) => {
116116
// Start in a new thread, we can have multiple requests.
117117
thread::spawn(move || {
118-
info!("Received configure request");
119-
let now = SystemTime::now();
120-
121-
// Expand glob patterns before acquiring the write lock so we
122-
// don't block readers/writers while traversing the filesystem.
123-
let workspace_directories = configure_options.workspace_directories.map(|dirs| {
124-
trace!("Expanding workspace directory patterns: {:?}", dirs);
118+
let mut cfg = context.configuration.write().unwrap();
119+
// Expand glob patterns in workspace_directories
120+
cfg.workspace_directories = configure_options.workspace_directories.map(|dirs| {
125121
expand_glob_patterns(&dirs)
126122
.into_iter()
127123
.filter(|p| p.is_dir())
128124
.collect()
129125
});
130-
let environment_directories =
126+
cfg.conda_executable = configure_options.conda_executable;
127+
// Expand glob patterns in environment_directories
128+
cfg.environment_directories =
131129
configure_options.environment_directories.map(|dirs| {
132-
trace!("Expanding environment directory patterns: {:?}", dirs);
133130
expand_glob_patterns(&dirs)
134131
.into_iter()
135132
.filter(|p| p.is_dir())
136133
.collect()
137134
});
138-
trace!(
139-
"Glob expansion completed in {:?}",
140-
now.elapsed().unwrap_or_default()
141-
);
142-
143-
let mut cfg = context.configuration.write().unwrap();
144-
cfg.workspace_directories = workspace_directories;
145-
cfg.conda_executable = configure_options.conda_executable;
146-
cfg.environment_directories = environment_directories;
147135
cfg.pipenv_executable = configure_options.pipenv_executable;
148136
cfg.poetry_executable = configure_options.poetry_executable;
149137
// We will not support changing the cache directories once set.
@@ -158,10 +146,6 @@ pub fn handle_configure(context: Arc<Context>, id: u32, params: Value) {
158146
for locator in context.locators.iter() {
159147
locator.configure(&config);
160148
}
161-
info!(
162-
"Configure completed in {:?}",
163-
now.elapsed().unwrap_or_default()
164-
);
165149
send_reply(id, None::<()>);
166150
});
167151
}

0 commit comments

Comments
 (0)