mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
@@ -8,9 +8,10 @@ use rpc_toolkit::{
|
||||
|
||||
use crate::context::{CliContext, DiagnosticContext, RpcContext};
|
||||
use crate::init::SYSTEM_REBUILD_PATH;
|
||||
use crate::prelude::*;
|
||||
use crate::shutdown::Shutdown;
|
||||
use crate::util::io::delete_file;
|
||||
use crate::{Error, DATA_DIR};
|
||||
use crate::DATA_DIR;
|
||||
|
||||
pub fn diagnostic<C: Context>() -> ParentHandler<C> {
|
||||
ParentHandler::new()
|
||||
@@ -74,7 +75,8 @@ pub fn restart(ctx: DiagnosticContext) -> Result<(), Error> {
|
||||
.map(|guid| (guid, Path::new(DATA_DIR).to_owned())),
|
||||
restart: true,
|
||||
})
|
||||
.expect("receiver dropped");
|
||||
.map_err(|_| eyre!("receiver dropped"))
|
||||
.log_err();
|
||||
Ok(())
|
||||
}
|
||||
pub async fn rebuild(ctx: DiagnosticContext) -> Result<(), Error> {
|
||||
|
||||
@@ -91,8 +91,8 @@ pub async fn shutdown(ctx: RpcContext) -> Result<(), Error> {
|
||||
export_args: Some((ctx.disk_guid.clone(), Path::new(DATA_DIR).to_owned())),
|
||||
restart: false,
|
||||
}))
|
||||
.map_err(|_| ())
|
||||
.expect("receiver dropped");
|
||||
.map_err(|_| eyre!("receiver dropped"))
|
||||
.log_err();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -112,8 +112,8 @@ pub async fn restart(ctx: RpcContext) -> Result<(), Error> {
|
||||
export_args: Some((ctx.disk_guid.clone(), Path::new(DATA_DIR).to_owned())),
|
||||
restart: true,
|
||||
}))
|
||||
.map_err(|_| ())
|
||||
.expect("receiver dropped");
|
||||
.map_err(|_| eyre!("receiver dropped"))
|
||||
.log_err();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user