Skip to content

Commit

Permalink
Add 'ignore_existing_conns' to scheduler config
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiezzel committed Sep 11, 2024
1 parent de2d18e commit 4969dd5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions crates/network-scheduler/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ scheduler_state_bucket: network-scheduler-state-test
supported_worker_versions: ">=1.0.0-rc3"
recommended_worker_versions: ">=1.0.0"
jail_unreachable: false
ignore_existing_conns: false
ping_processing_threads: 16
2 changes: 2 additions & 0 deletions crates/network-scheduler/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ pub struct Config {
pub recommended_worker_versions: VersionReq,
#[serde(default)]
pub jail_unreachable: bool,
#[serde(default)]
pub ignore_existing_conns: bool,
#[serde(default = "num_cpus::get")]
pub ping_processing_threads: usize,
#[serde(skip_serializing, skip_deserializing, default)]
Expand Down
10 changes: 7 additions & 3 deletions crates/network-scheduler/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use clap::Parser;
use env_logger::Env;
use prometheus_client::registry::Registry;

use sqd_network_transport::P2PTransportBuilder;
use sqd_network_transport::{P2PTransportBuilder, SchedulerConfig};

use crate::cli::Cli;
use crate::cli::{Cli, Config};
use crate::server::Server;
use crate::storage::S3Storage;

Expand Down Expand Up @@ -45,8 +45,12 @@ async fn main() -> anyhow::Result<()> {
let transport_builder = P2PTransportBuilder::from_cli(args.transport).await?;
let contract_client: Box<dyn sqd_contract_client::Client> = transport_builder.contract_client();
let local_peer_id = transport_builder.local_peer_id();
let scheduler_config = SchedulerConfig {
ignore_existing_conns: Config::get().ignore_existing_conns,
..Default::default()
};
let (incoming_messages, transport_handle) =
transport_builder.build_scheduler(Default::default())?;
transport_builder.build_scheduler(scheduler_config)?;

// Get scheduling units
let storage = S3Storage::new(local_peer_id).await;
Expand Down

0 comments on commit 4969dd5

Please sign in to comment.