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(cargo-shuttle): windows build #1648

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions cargo-shuttle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,6 @@ impl Shuttle {
#[cfg(target_family = "windows")]
async fn local_run(&self, mut run_args: RunArgs) -> Result<CommandOutcome> {
let services = self.pre_local_run(&run_args).await?;
let (provisioner_server, provisioner_port) = Shuttle::setup_local_provisioner().await?;

// Start all the services.
let mut runtimes: Vec<(Child, runtime::Client)> = Vec::new();
Expand All @@ -1499,8 +1498,8 @@ impl Shuttle {
let mut signal_received = false;
for (i, service) in services.iter().enumerate() {
signal_received = tokio::select! {
res = Shuttle::spin_local_runtime(&run_args, service, &provisioner_server, i as u16, provisioner_port) => {
Shuttle::add_runtime_info(res.unwrap(), &mut runtimes, &[&provisioner_server]).await?;
res = Shuttle::spin_local_runtime(&run_args, service, i as u16) => {
Shuttle::add_runtime_info(res.unwrap(), &mut runtimes).await?;
false
},
_ = Shuttle::handle_signals() => {
Expand All @@ -1519,7 +1518,6 @@ impl Shuttle {
// If prior signal received is set to true we must stop all the existing runtimes and
// exit the `local_run`.
if signal_received {
provisioner_server.abort();
for (mut rt, mut rt_client) in runtimes {
Shuttle::stop_runtime(&mut rt, &mut rt_client)
.await
Expand Down Expand Up @@ -1557,7 +1555,6 @@ impl Shuttle {
println!(
"Killing all the runtimes..."
);
provisioner_server.abort();
Shuttle::stop_runtime(&mut rt, &mut rt_client).await.unwrap_or_else(|err| {
trace!(status = ?err, "stopping the runtime errored out");
});
Expand Down