From fbbcb1842b28c3fdcfead2989ba25472e27f901e Mon Sep 17 00:00:00 2001 From: ghassmo Date: Mon, 28 Mar 2022 10:28:18 +0400 Subject: [PATCH] bin/taud: check if due timestamp is not less than current timestamp --- bin/taud/src/task_info.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/taud/src/task_info.rs b/bin/taud/src/task_info.rs index 76c6c17dc..c28fadffe 100644 --- a/bin/taud/src/task_info.rs +++ b/bin/taud/src/task_info.rs @@ -81,6 +81,12 @@ impl TaskInfo { let id: u32 = find_free_id(&task_ids); + if let Some(d) = &due { + if *d < get_current_time() { + return Err(TaudError::InvalidDueTime) + } + } + Ok(Self { ref_id, id,