fix output error on stop

This commit is contained in:
elvece
2021-10-12 13:32:57 -06:00
committed by Aiden McClelland
parent 786a13fcb3
commit a59f0b18ca

View File

@@ -15,6 +15,7 @@ use torut::onion::TorSecretKeyV3;
use tracing::instrument; use tracing::instrument;
use crate::action::docker::DockerAction; use crate::action::docker::DockerAction;
use crate::action::NoOutput;
use crate::context::RpcContext; use crate::context::RpcContext;
use crate::net::interface::InterfaceId; use crate::net::interface::InterfaceId;
use crate::notifications::{NotificationLevel, NotificationSubtype}; use crate::notifications::{NotificationLevel, NotificationSubtype};
@@ -143,13 +144,15 @@ pub enum OnStop {
} }
#[instrument(skip(state))] #[instrument(skip(state))]
async fn run_main(state: &Arc<ManagerSharedState>) -> Result<Result<(), (i32, String)>, Error> { async fn run_main(
state: &Arc<ManagerSharedState>,
) -> Result<Result<NoOutput, (i32, String)>, Error> {
let rt_state = state.clone(); let rt_state = state.clone();
let mut runtime = tokio::spawn(async move { let mut runtime = tokio::spawn(async move {
rt_state rt_state
.manifest .manifest
.main .main
.execute::<(), ()>( .execute::<(), NoOutput>(
&rt_state.ctx, &rt_state.ctx,
&rt_state.manifest.id, &rt_state.manifest.id,
&rt_state.manifest.version, &rt_state.manifest.version,
@@ -300,7 +303,7 @@ impl Manager {
} }
} }
match run_main(&thread_shared).await { match run_main(&thread_shared).await {
Ok(Ok(())) => { Ok(Ok(NoOutput)) => {
thread_shared thread_shared
.on_stop .on_stop
.send(OnStop::Sleep) .send(OnStop::Sleep)