feat: add interval field to AnnounceHostRequest (#562)

Signed-off-by: BruceAko <chongzhi@hust.edu.cn>
This commit is contained in:
Chongzhi Deng 2024-07-01 11:04:24 +08:00 committed by GitHub
parent e22592dada
commit 16a16c2de2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 4 deletions

4
Cargo.lock generated
View File

@ -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",

View File

@ -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"] }

View File

@ -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)?,
),
})
}
}