Hello All,
I am trying to create a tokio-timer with a long interval around 600seconds.
Following is the sample code.
let mut core = Core::new().unwrap();
let duration = Duration::new(410, 0);
println!("duration in secs: {}", duration.as_secs());
let wakeup_interval = Timer::default().interval(duration);
let timer = wakeup_interval.for_each(move|()| {
println!("Timer expired");
Ok(())
});
let timer_future = timer.map(|_| {
println!("Timer run success");
()
}).map_err(|err| {
println!("Failed to run timer, reason:: {:?}", err);
()
});
core.run(timer_future);
The above code works fine(Timer expires repeatedly in the given interval), if the duration is lesser than or equal to 409 seconds.
When the duration is on or above 410 seconds, it exits with following error:
Failed to run timer, reason:: TooLong
I'm confused with the above behavior. Looks like there is some limitation on the input duration for the timer.
Is it possible to increase this limit to higher number?
Any help on this would be highly appreciated.
Thanks in advance!!!