mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 22:46:29 +03:00
Schedule ephemeral task 1 second later
This accounts for 1-second rounding, otherwise the task is always too early.
This commit is contained in:
committed by
link2xt
parent
0b187131b2
commit
d4dea0d5c6
@@ -365,8 +365,9 @@ pub async fn schedule_ephemeral_task(context: &Context) {
|
||||
|
||||
if let Some(ephemeral_timestamp) = ephemeral_timestamp {
|
||||
let now = SystemTime::now();
|
||||
let until =
|
||||
UNIX_EPOCH + Duration::from_secs(ephemeral_timestamp.try_into().unwrap_or(u64::MAX));
|
||||
let until = UNIX_EPOCH
|
||||
+ Duration::from_secs(ephemeral_timestamp.try_into().unwrap_or(u64::MAX))
|
||||
+ Duration::from_secs(1);
|
||||
|
||||
if let Ok(duration) = until.duration_since(now) {
|
||||
// Schedule a task, ephemeral_timestamp is in the future
|
||||
|
||||
Reference in New Issue
Block a user