Skip to content

Commit 0840677

Browse files
committed
Use tokio correctly by informing it we're about to block
1 parent 78ef67f commit 0840677

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/dsc-lib/src/dscresources/command_resource.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,10 +785,8 @@ pub fn invoke_command(executable: &str, args: Option<Vec<String>>, input: Option
785785
// Try to use existing runtime first (e.g. from gRPC or MCP server)
786786
match tokio::runtime::Handle::try_current() {
787787
Ok(handle) => {
788-
std::thread::scope(|s| {
789-
s.spawn(|| {
790-
handle.block_on(run_async)
791-
}).join().unwrap()
788+
tokio::task::block_in_place(|| {
789+
handle.block_on(run_async)
792790
})
793791
},
794792
// Otherwise create a new runtime

0 commit comments

Comments
 (0)