fix(dc_job): dont subtract too much

This commit is contained in:
dignifiedquire
2019-05-12 22:17:11 +02:00
parent fdd870286e
commit 693474d5be

View File

@@ -1235,8 +1235,12 @@ unsafe fn get_next_wakeup_time(context: &dc_context_t, thread: libc::c_int) -> D
.duration_since(SystemTime::UNIX_EPOCH)
.unwrap();
if t > 0 {
println!("{:?} {:?} {:?}", t, now, Duration::new(t, 0));
wakeup_time = Duration::new(t, 0) - now;
let t = Duration::new(t, 0);
if t > now {
wakeup_time = t - now;
} else {
wakeup_time = Duration::new(0, 0);
}
}
}