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

Adds zini restart subcommand #55

Merged
merged 4 commits into from
Oct 16, 2023
Merged

Adds zini restart subcommand #55

merged 4 commits into from
Oct 16, 2023

Conversation

ashraffouda
Copy link
Contributor

No description provided.

Signed-off-by: Ashraf Fouda <[email protected]>
src/app/mod.rs Outdated
let mut count = 0;
while count <= 20 {
let result = client.status(name).await?;
if result.state == "Success" && result.target == "Down" {
Copy link
Member

Choose a reason for hiding this comment

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

i think it's better to check the PID not the state, because the stat can still be Error or other when it's stopped bardo

src/app/mod.rs Outdated
client.start(name).await?;
return Ok(());
}
time::sleep(std::time::Duration::from_secs(2)).await;
Copy link
Member

Choose a reason for hiding this comment

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

so we wait for 40 seconds? isn't this a bit too long?
I say we try every 1 second instead of 2

src/app/mod.rs Outdated
return Ok(());
}
time::sleep(std::time::Duration::from_secs(2)).await;
count += 1;
Copy link
Member

Choose a reason for hiding this comment

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

when u switch to for u won't need this

@muhamadazmy muhamadazmy merged commit 407e730 into master Oct 16, 2023
1 check passed
@muhamadazmy muhamadazmy deleted the zinit-restart branch October 16, 2023 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants