1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-01-14 02:33:13 +02:00

Update cron logic

This commit is contained in:
Ralph Slooten 2024-02-17 23:19:32 +13:00
parent 5458b1044f
commit f067b76c58

View File

@ -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 {