reflect: add get_check_inverval_secs
This commit is contained in:
@@ -19,6 +19,10 @@ struct KeepRunningConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl KeepRunningConfig {
|
impl KeepRunningConfig {
|
||||||
|
fn get_check_inverval_secs(&self) -> u64 {
|
||||||
|
self.check_inverval_secs.unwrap_or(60 * 60)
|
||||||
|
}
|
||||||
|
|
||||||
fn is_show_debug_output(&self) -> bool {
|
fn is_show_debug_output(&self) -> bool {
|
||||||
self.show_debug_output.unwrap_or(false)
|
self.show_debug_output.unwrap_or(false)
|
||||||
}
|
}
|
||||||
@@ -70,7 +74,7 @@ fn main() {
|
|||||||
for check_cnt in 0.. {
|
for check_cnt in 0.. {
|
||||||
info!("Check index: {} @{:?}", check_cnt, Local::now());
|
info!("Check index: {} @{:?}", check_cnt, Local::now());
|
||||||
keep_runningd(keep_running_config.clone());
|
keep_runningd(keep_running_config.clone());
|
||||||
thread::sleep(Duration::from_secs(keep_running_config.check_inverval_secs.unwrap_or(60 * 60)));
|
thread::sleep(Duration::from_secs(keep_running_config.get_check_inverval_secs()));
|
||||||
}
|
}
|
||||||
|
|
||||||
drop(the_file_lock);
|
drop(the_file_lock);
|
||||||
|
|||||||
Reference in New Issue
Block a user