Skip to content

Commit

Permalink
fix: rename mirrors' check_pause_elapsed to health_check_pause_elapsed
Browse files Browse the repository at this point in the history
Signed-off-by: BruceAko <chongzhi@hust.edu.cn>
  • Loading branch information
BruceAko committed Jul 9, 2024
1 parent bb18970 commit 1883e40
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ pub struct MirrorConfig {
pub failure_limit: u8,
/// Elapsed time to pause mirror health check when the request is inactive, in seconds.
#[serde(default = "default_check_pause_elapsed")]
pub check_pause_elapsed: u64,
pub health_check_pause_elapsed: u64,
}

impl Default for MirrorConfig {
Expand All @@ -955,7 +955,7 @@ impl Default for MirrorConfig {
health_check_interval: 5,
failure_limit: 5,
ping_url: String::new(),
check_pause_elapsed: 300,
health_check_pause_elapsed: 300,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/nydusd.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ Currently, the mirror mode is only tested in the registry backend, and in theory
"failure_limit": 5,
// Elapsed time to pause mirror health check when the request is inactive, in seconds.
// Use 300 as default if left empty.
"check_pause_elapsed": 300,
"health_check_pause_elapsed": 300,
},
{
"host": "http://dragonfly2.io:65001",
Expand Down
2 changes: 1 addition & 1 deletion storage/src/backend/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ impl Connection {
.as_secs()
- last_active.load(Ordering::Relaxed);
// If the connection is not active for a set time, skip mirror health check.
if elapsed <= mirror_cloned.config.check_pause_elapsed {
if elapsed <= mirror_cloned.config.health_check_pause_elapsed {
// Try to recover the mirror server when it is unavailable.
if !mirror_cloned.status.load(Ordering::Relaxed) {
info!(
Expand Down

0 comments on commit 1883e40

Please sign in to comment.