From 738c0826c8a0feedb112cebf9d904edf45354e22 Mon Sep 17 00:00:00 2001 From: ditatompel Date: Wed, 8 May 2024 19:28:42 +0700 Subject: [PATCH] Delete old probe logs older than 1 month +2 days --- internal/repo/cron.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/repo/cron.go b/internal/repo/cron.go index 30798e7..1589b5f 100644 --- a/internal/repo/cron.go +++ b/internal/repo/cron.go @@ -176,8 +176,8 @@ func (repo *CronRepo) execCron(slug string) { } func (repo *CronRepo) deleteOldProbeLogs() { - // for now, we only delete stats older than 2 days - startTs := time.Now().AddDate(0, 0, -2).Unix() + // for now, we only delete stats older than 1 month +2 days + startTs := time.Now().AddDate(0, -1, -2).Unix() query := `DELETE FROM tbl_probe_log WHERE date_checked < ?` _, err := repo.db.Exec(query, startTs) if err != nil {