stagger the flush timing a little bit

noticed it's hitting exactly when NTP updates because it also
happens on a 24-hour schedule, staggering a bit to try and keep
everything from hitting exactly at the same time once a day.
This commit is contained in:
bunnie 2022-07-29 15:00:44 +08:00
parent 2c815375a1
commit e469736278

View file

@ -534,7 +534,7 @@ fn wrapped_main() -> ! {
let tt = ticktimer_server::Ticktimer::new().unwrap();
let mut flush_interval = 0;
const ARBITRARY_INTERVAL_MS: usize = 12_513;
const PERIODIC_FLUSH_MS: usize = 86_400_000; // one day
const PERIODIC_FLUSH_MS: usize = 1000 * 60 * 60 * 18 - 5555; // every 18 hours less ~5 seconds to try and stagger the process off of other periodics
loop {
tt.sleep_ms(ARBITRARY_INTERVAL_MS).unwrap(); // arbitrary interval, but trying to avoid "round" numbers of seconds to interleave periodic tasks
flush_interval += ARBITRARY_INTERVAL_MS;