Skip to content

Commit

Permalink
fix: Adding in the missing suggestions that Aiden has poinited out
Browse files Browse the repository at this point in the history
  • Loading branch information
Blu-J committed Dec 18, 2023
1 parent 18ac9ca commit 462eed2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 9 additions & 2 deletions core/startos/src/manager/manager_seed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ impl ManagerSeed {
)
.await
{
Err(e) if e.kind == ErrorKind::NotFound => (), // Already stopped
Err(e) if e.kind == ErrorKind::Timeout => (), // Already stopped In theory
Err(e) if e.kind == ErrorKind::NotFound => {
tracing::info!(
"Command for package {command_id} should already be stopped",
command_id = &self.manifest.id
);
} // Already stopped
Err(e) if e.kind == ErrorKind::Timeout => {
tracing::warn!("Command for package {command_id} had to be timed out, but we have dropped which means it should be killed", command_id = &self.manifest.id);
} // Already stopped In theory
a => a?,
}
Ok(())
Expand Down
5 changes: 2 additions & 3 deletions core/startos/src/util/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,10 @@ pub async fn stop_container(
signal: Option<Signal>,
) -> Result<(), Error> {
let mut cmd = Command::new(CONTAINER_TOOL);
let mut cmd = cmd.timeout(timeout);
cmd.arg("stop");
if let Some(dur) = timeout {
cmd.arg("-t")
.arg(dur.as_secs().to_string())
.timeout(Some(dur));
cmd.arg("-t").arg(dur.as_secs().to_string());
}
if let Some(sig) = signal {
cmd.arg("-s").arg(sig.to_string());
Expand Down

0 comments on commit 462eed2

Please sign in to comment.