fixup after rebase

This commit is contained in:
Aiden McClelland
2023-03-09 15:02:09 -07:00
parent 5e9e26fa67
commit 18922a1c6d
24 changed files with 40 additions and 779 deletions

View File

@@ -12,7 +12,6 @@ use sqlx::Acquire;
use crate::{
config::hook::ConfigHook,
manager::{start_stop::StartStop, Manager},
net::keys::Key,
};
use super::try_get_running_ip;
@@ -165,26 +164,29 @@ impl OsApi for Manager {
Ok(())
}
fn set_started(&self) {
fn set_started(&self) -> Result<(), Report> {
self.manage_container
.current_state
.send(StartStop::Start)
.unwrap_or_default()
.send_modify(|x| *x = StartStop::Start);
Ok(())
}
async fn restart(&self) {
self.perform_restart().await
async fn restart(&self) -> Result<(), Report> {
self.perform_restart().await;
Ok(())
}
async fn start(&self) {
async fn start(&self) -> Result<(), Report> {
self.manage_container
.wait_for_desired(StartStop::Start)
.await
.await;
Ok(())
}
async fn stop(&self) {
async fn stop(&self) -> Result<(), Report> {
self.manage_container
.wait_for_desired(StartStop::Stop)
.await
.await;
Ok(())
}
}