clippy pedantic clean + wired into flake checks
This commit is contained in:
parent
f12837fe32
commit
fef2dee92a
12 changed files with 55 additions and 25 deletions
|
|
@ -13,7 +13,7 @@ use tokio::net::{UnixListener, UnixStream};
|
|||
use crate::coordinator::Coordinator;
|
||||
use crate::lifecycle;
|
||||
|
||||
pub async fn start(coord: Arc<Coordinator>) -> Result<()> {
|
||||
pub fn start(coord: Arc<Coordinator>) -> Result<()> {
|
||||
let dir = Coordinator::manager_dir();
|
||||
std::fs::create_dir_all(&dir)
|
||||
.with_context(|| format!("create manager dir {}", dir.display()))?;
|
||||
|
|
@ -71,7 +71,7 @@ async fn serve(stream: UnixStream, coord: Arc<Coordinator>) -> Result<()> {
|
|||
|
||||
async fn dispatch(req: &ManagerRequest, coord: &Coordinator) -> ManagerResponse {
|
||||
match req {
|
||||
ManagerRequest::Send { to, body } => match coord.broker.send(Message {
|
||||
ManagerRequest::Send { to, body } => match coord.broker.send(&Message {
|
||||
from: MANAGER_AGENT.to_owned(),
|
||||
to: to.clone(),
|
||||
body: body.clone(),
|
||||
|
|
@ -94,7 +94,7 @@ async fn dispatch(req: &ManagerRequest, coord: &Coordinator) -> ManagerResponse
|
|||
ManagerRequest::Spawn { name } => {
|
||||
tracing::info!(%name, "manager: spawn");
|
||||
let result: Result<()> = async {
|
||||
let agent_dir = coord.register_agent(name).await?;
|
||||
let agent_dir = coord.register_agent(name)?;
|
||||
if let Err(e) = lifecycle::spawn(name, &coord.agent_flake, &agent_dir).await {
|
||||
coord.unregister_agent(name);
|
||||
return Err(e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue