Skip to content

Commit 543db99

Browse files
Fix docs
1 parent ee7ad63 commit 543db99

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

agent-info/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ edition.workspace = true
66
version.workspace = true
77
license.workspace = true
88

9+
[lib]
10+
bench = false
11+
912
[dependencies]
1013
anyhow = "1.0.86"
1114
arc-swap = "1.7.1"

agent-info/src/fetcher.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ async fn fetch_info_with_state(
5555

5656
/// Fetch the info endpoint once and return the info.
5757
///
58-
/// Can be used for one-time access to the agent's info. If you need to access the info over
59-
/// long period use `AgentInfoFetcher` to keep the info up-to-date.
58+
/// Can be used for one-time access to the agent's info. If you need to access the info several
59+
/// times use `AgentInfoFetcher` to keep the info up-to-date.
6060
///
6161
/// # Example
6262
/// ```no_run
@@ -78,7 +78,7 @@ pub async fn fetch_info(info_endpoint: &Endpoint) -> Result<Box<AgentInfo>> {
7878
}
7979
}
8080

81-
/// Fetch the info endpoint and update an ArcSwap based on a given time interval.
81+
/// Fetch the info endpoint and update an ArcSwap keeping it up-to-date.
8282
///
8383
/// Once the fetcher has been created you can get an Arc of the config by calling `get_info`.
8484
/// You can then start the run method, the fetcher will update the AgentInfoArc based on the
@@ -120,17 +120,18 @@ pub struct AgentInfoFetcher {
120120
impl AgentInfoFetcher {
121121
/// Return a new `AgentInfoFetcher` fetching the `info_endpoint` on each `refresh_interval`
122122
/// and updating the stored info.
123-
pub fn new(info_endpoint: Endpoint, fetch_interval: Duration) -> Self {
123+
pub fn new(info_endpoint: Endpoint, refresh_interval: Duration) -> Self {
124124
Self {
125125
info_endpoint,
126126
info: Arc::new(ArcSwapOption::new(None)),
127-
refresh_interval: fetch_interval,
127+
refresh_interval,
128128
}
129129
}
130130

131131
/// Start fetching the info endpoint with the given interval.
132132
///
133-
/// Warning: This method does not return and should be called within a dedicated task.
133+
/// # Warning
134+
/// This method does not return and should be called within a dedicated task.
134135
pub async fn run(&self) {
135136
loop {
136137
let current_info = self.info.load();

0 commit comments

Comments
 (0)