fix locker issues

This commit is contained in:
Aiden McClelland
2021-09-27 15:28:33 -06:00
parent 9c1b7a9578
commit 5c2564477e
4 changed files with 17 additions and 7 deletions

View File

@@ -13,7 +13,9 @@ use crate::config::{Config, ConfigSpec};
use crate::context::RpcContext; use crate::context::RpcContext;
use crate::id::{Id, InvalidId}; use crate::id::{Id, InvalidId};
use crate::s9pk::manifest::PackageId; use crate::s9pk::manifest::PackageId;
use crate::util::{IoFormat, ValuePrimative, Version, display_serializable, parse_stdin_deserializable}; use crate::util::{
display_serializable, parse_stdin_deserializable, IoFormat, ValuePrimative, Version,
};
use crate::volume::Volumes; use crate::volume::Volumes;
use crate::{Error, ResultExt}; use crate::{Error, ResultExt};
@@ -80,7 +82,7 @@ pub enum ActionResult {
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
pub struct ActionResultV0 { pub struct ActionResultV0 {
pub message: String, pub message: String,
pub value: ValuePrimative, pub value: Option<String>,
pub copyable: bool, pub copyable: bool,
pub qr: bool, pub qr: bool,
} }
@@ -183,8 +185,12 @@ fn display_action_result(action_result: ActionResult, matches: &ArgMatches<'_>)
} }
match action_result { match action_result {
ActionResult::V0(ar) => { ActionResult::V0(ar) => {
println!("{}: {}", ar.message, serde_json::to_string(&ar.value).unwrap()); println!(
}, "{}: {}",
ar.message,
serde_json::to_string(&ar.value).unwrap()
);
}
} }
} }

View File

@@ -351,7 +351,8 @@ impl Manager {
.await .await
{ {
Err(bollard::errors::Error::DockerResponseNotFoundError { .. }) Err(bollard::errors::Error::DockerResponseNotFoundError { .. })
| Err(bollard::errors::Error::DockerResponseConflictError { .. }) => (), // Already stopped | Err(bollard::errors::Error::DockerResponseConflictError { .. })
| Err(bollard::errors::Error::DockerResponseNotModifiedError { .. }) => (), // Already stopped
a => a?, a => a?,
}; };
self.shared.status.store( self.shared.status.store(
@@ -413,7 +414,8 @@ impl Manager {
.await .await
{ {
Err(bollard::errors::Error::DockerResponseNotFoundError { .. }) Err(bollard::errors::Error::DockerResponseNotFoundError { .. })
| Err(bollard::errors::Error::DockerResponseConflictError { .. }) => (), | Err(bollard::errors::Error::DockerResponseConflictError { .. })
| Err(bollard::errors::Error::DockerResponseNotModifiedError { .. }) => (), // Already stopped
a => a?, a => a?,
}; };
self.shared.status.store( self.shared.status.store(

View File

@@ -301,7 +301,9 @@ impl MainStatus {
}, },
ManagerStatus::Running => match self { ManagerStatus::Running => match self {
MainStatus::Stopped | MainStatus::Stopping | MainStatus::Restoring { .. } => { MainStatus::Stopped | MainStatus::Stopping | MainStatus::Restoring { .. } => {
dbg!("stopping");
manager.stop().await?; manager.stop().await?;
dbg!("stopped");
} }
MainStatus::Running { .. } => (), MainStatus::Running { .. } => (),
MainStatus::BackingUp { .. } => { MainStatus::BackingUp { .. } => {