From f067b76c5822cce1836aabeabee270ca64cbe901 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Sat, 17 Feb 2024 23:19:32 +1300 Subject: [PATCH] Update cron logic --- internal/storage/cron.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/storage/cron.go b/internal/storage/cron.go index 8309d18..5a7bc60 100644 --- a/internal/storage/cron.go +++ b/internal/storage/cron.go @@ -3,6 +3,7 @@ package storage import ( "context" "database/sql" + "math" "strings" "time" @@ -21,7 +22,7 @@ func dbCron() { sinceLastDbAction := currentTime.Sub(dbLastAction) // only run the database has been idle for 5 minutes - if sinceLastDbAction.Minutes() >= 5 { + if math.Floor(sinceLastDbAction.Minutes()) == 5 { deletedSize := getDeletedSize() if deletedSize > 0 {