Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
464 changes: 464 additions & 0 deletions crates/orchestrator/src/cli.rs

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion crates/orchestrator/src/discovery/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use std::sync::Arc;
use std::time::Duration;
use tokio::sync::mpsc::Sender;
use tokio::time::interval;
use tokio_util::sync::CancellationToken;

#[derive(Clone)]
struct NodeFetcher {
Expand Down Expand Up @@ -362,7 +363,7 @@ impl DiscoveryMonitor {
})
}

pub async fn run(self) {
pub async fn run(self, cancellation_token: CancellationToken) {
use futures::StreamExt as _;

let Self {
Expand Down Expand Up @@ -444,6 +445,10 @@ impl DiscoveryMonitor {
}
}
}
_ = cancellation_token.cancelled() => {
error!("Shutdown signal received, stopping discovery monitor");
break;
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/orchestrator/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod api;
mod cli;
mod discovery;
mod metrics;
mod models;
Expand All @@ -11,6 +12,7 @@ mod store;
mod utils;

pub use api::server::start_server;
pub use cli::Cli;
pub use discovery::monitor::DiscoveryMonitor;
pub use metrics::sync_service::MetricsSyncService;
pub use metrics::webhook_sender::MetricsWebhookSender;
Expand Down
Loading