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: error if sandbox process has already started #135

Merged
merged 1 commit into from
May 13, 2022
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
4 changes: 4 additions & 0 deletions workspaces/src/network/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ impl SandboxServer {
}

pub fn start(&mut self) -> anyhow::Result<()> {
if self.process.is_some() {
anyhow::bail!("Sandbox server already started");
}
Comment on lines 27 to +30
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, what case were you hitting where start was being called multiple times? Still good to have this in here just in case though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but reading the logic it seemed like it could be a hidden bug if logic changed external to this method


info!(target: "workspaces", "Starting up sandbox at localhost:{}", self.rpc_port);
let home_dir = Sandbox::home_dir(self.rpc_port);

Expand Down