diff --git a/Cargo.lock b/Cargo.lock index 559511a3a5f..5a82de8a83f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -950,9 +950,9 @@ dependencies = [ [[package]] name = "dragonfly-api" -version = "2.0.124" +version = "2.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab958fa6959f459c170f87cccae5adae0010fc3be09b9f98a433b898a7f4158" +checksum = "207061abbe99efaa0d5346e6c0e301a4039e2e855853bc59dbe062596edc1a20" dependencies = [ "prost 0.11.9", "prost-types 0.12.6", diff --git a/Cargo.toml b/Cargo.toml index 4461a844519..bd4232f9393 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ dragonfly-client-backend = { path = "dragonfly-client-backend", version = "0.1.8 dragonfly-client-util = { path = "dragonfly-client-util", version = "0.1.82" } dragonfly-client-init = { path = "dragonfly-client-init", version = "0.1.82" } thiserror = "1.0" -dragonfly-api = "2.0.124" +dragonfly-api = "2.0.126" reqwest = { version = "0.12.4", features = ["stream", "native-tls", "default-tls", "rustls-tls"] } rcgen = { version = "0.12.1", features = ["x509-parser"] } hyper = { version = "1.2", features = ["full"] } diff --git a/dragonfly-client/src/announcer/mod.rs b/dragonfly-client/src/announcer/mod.rs index 26a0aadc2f4..145ba5ebe0b 100644 --- a/dragonfly-client/src/announcer/mod.rs +++ b/dragonfly-client/src/announcer/mod.rs @@ -23,6 +23,7 @@ use dragonfly_client_config::{ dfdaemon::{Config, HostType}, CARGO_PKG_RUSTC_VERSION, CARGO_PKG_VERSION, GIT_HASH, }; +use dragonfly_client_core::error::{ErrorType, OrErr}; use dragonfly_client_core::Result; use std::env; use std::sync::Arc; @@ -272,6 +273,12 @@ impl SchedulerAnnouncer { scheduler_cluster_id: 0, }; - Ok(AnnounceHostRequest { host: Some(host) }) + Ok(AnnounceHostRequest { + host: Some(host), + interval: Some( + prost_wkt_types::Duration::try_from(self.config.scheduler.announce_interval) + .or_err(ErrorType::ParseError)?, + ), + }) } }