Skip to content

Commit

Permalink
initial delay on NTP poller
Browse files Browse the repository at this point in the history
no point in clogging up the boot sequence with requests that
will almost certainly fail.
  • Loading branch information
bunnie committed Nov 5, 2022
1 parent 4264231 commit 601f347
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions apps/vault/src/prereqs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ pub(crate) fn ntp_updater(time_conn: xous::CID) {
let tt = ticktimer_server::Ticktimer::new().unwrap();
let mut now = SystemTime::now();
let mut force_update = true;
tt.sleep_ms(1000 * 60 * 2); // initial delay of 2 minutes before polling. This gives plenty of time for network to come up.
loop {
if force_update || now.elapsed().unwrap().as_secs() > 3600 * 24 { // once a day in real time
// check if we have a network connection. if not, repeat the loop, after a short delay
Expand Down

0 comments on commit 601f347

Please sign in to comment.