Skip to content

Commit

Permalink
more mess
Browse files Browse the repository at this point in the history
  • Loading branch information
leon3s committed Jan 5, 2024
1 parent 4d29fd5 commit 24cc7e9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions bin/nanocld/src/objects/cargo.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use futures_util::{stream::FuturesUnordered, StreamExt};
use futures_util::{StreamExt, stream::FuturesUnordered};
use bollard_next::{
container::{RemoveContainerOptions, Config},
service::HostConfig,
container::{RemoveContainerOptions, Config},
};

use nanocl_error::http::{HttpResult, HttpError};
use nanocl_stubs::{
process::ProcessKind,
cargo::{Cargo, CargoDeleteQuery},
cargo_spec::{ReplicationMode, CargoSpecPartial},
process::ProcessKind,
};

use crate::{
Expand Down
5 changes: 2 additions & 3 deletions bin/nanocld/src/subsystem/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use notify::{Config, Watcher, RecursiveMode, RecommendedWatcher};
use nanocl_error::io::{FromIo, IoResult, IoError};
use nanocl_stubs::config::DaemonConfig;

use crate::utils;
use crate::models::SystemState;
use crate::{utils, models::SystemState};

/// Create a new thread and watch for change in the run directory
/// and set the permission of the unix socket
Expand Down Expand Up @@ -136,7 +135,7 @@ pub async fn init(conf: &DaemonConfig) -> IoResult<SystemState> {
});
super::docker_event::analize(&system_state);
super::event::analize(&system_state);
utils::metric::spawn_logger(&system_state);
super::metric::spawn(&system_state);
Ok(system_state)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async fn save_metric(
/// Spawn a background thread that will listen to the metrics daemon
/// and save the metrics to the database.
/// The metrics are saved for the current node.
pub(crate) fn spawn_logger(state: &SystemState) {
pub(crate) fn spawn(state: &SystemState) {
let state = state.clone();
rt::Arbiter::new().exec_fn(move || {
let client = MetrsdClient::connect("unix:///run/nanocl/metrics.sock");
Expand Down
1 change: 1 addition & 0 deletions bin/nanocld/src/subsystem/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod init;
mod event;
mod metric;
mod docker_event;

pub use init::init;
1 change: 0 additions & 1 deletion bin/nanocld/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub(crate) mod vm_image;
pub(crate) mod job;
pub(crate) mod exec;
pub(crate) mod resource;
pub(crate) mod metric;
pub(crate) mod ctrl_client;
pub(crate) mod process;
pub(crate) mod server;
Expand Down

0 comments on commit 24cc7e9

Please sign in to comment.