Skip to content

Commit

Permalink
feat: add interval field to AnnounceHostRequest (dragonflyoss#562)
Browse files Browse the repository at this point in the history
Signed-off-by: BruceAko <chongzhi@hust.edu.cn>
  • Loading branch information
BruceAko authored Jul 1, 2024
1 parent e22592d commit 16a16c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
9 changes: 8 additions & 1 deletion dragonfly-client/src/announcer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)?,
),
})
}
}

0 comments on commit 16a16c2

Please sign in to comment.