correct arithmetic adjustments

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-05-05 20:40:58 -04:00 committed by June
parent 16a98b0683
commit 321e197d8c
12 changed files with 24 additions and 53 deletions

View file

@ -188,7 +188,9 @@ impl Service {
Ok(duration) => {
debug!("Parsed duration: {:?}", duration);
debug!("System time now: {:?}", SystemTime::now());
SystemTime::now().checked_sub(duration).unwrap()
SystemTime::now().checked_sub(duration).ok_or_else(|| {
Error::bad_database("Duration specified is not valid against the current system time")
})?
},
Err(e) => {
error!("Failed to parse user-specified time duration: {}", e);