mirror of
https://seed.radicle.dev/rad:zwTxygwuz5LDGBq255RA2CbNGrz8.git
synced 2026-11-29 06:40:31 +08:00
refactor(src/pages.rs): use a Duration instead of plain integer
Also, log the duration until the next update, to help impatient node operators to know what's going on. Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
+6
-2
@@ -32,7 +32,7 @@ use crate::{
|
||||
|
||||
const CSS: &str = include_str!("radicle-ci.css");
|
||||
const REFERESH_INTERVAL: &str = "300";
|
||||
const UPDATE_INTERVAL: u64 = 60;
|
||||
const UPDATE_INTERVAL: Duration = Duration::from_secs(60);
|
||||
|
||||
/// All possible errors returned from the status page module.
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
@@ -503,7 +503,11 @@ impl StatusPage {
|
||||
if once {
|
||||
return Ok(());
|
||||
}
|
||||
sleep(Duration::from_secs(UPDATE_INTERVAL));
|
||||
info!(
|
||||
"wait about {} seconds to update HTML report pages again",
|
||||
UPDATE_INTERVAL.as_secs()
|
||||
);
|
||||
sleep(UPDATE_INTERVAL);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user