report query fixes

This commit is contained in:
Yared Yemane 2025-08-20 15:56:50 +03:00
parent 0779cd35fe
commit 6425196115

View File

@ -135,10 +135,10 @@ func SetupReportCronJobs(ctx context.Context, reportService *report.Service, out
spec string
period string
}{
{
spec: "*/60 * * * * *", // Every 5 minutes
period: "5min",
},
// {
// spec: "*/60 * * * * *", // Every 5 minutes
// period: "5min",
// },
{
spec: "0 0 0 * * *", // Daily at midnight
period: "daily",
@ -161,9 +161,9 @@ func SetupReportCronJobs(ctx context.Context, reportService *report.Service, out
var from, to time.Time
switch period {
case "5min":
from = now.Add(-5 * time.Minute)
to = now
// case "5min":
// from = now.Add(-5 * time.Minute)
// to = now
case "daily":
from = time.Date(now.Year(), now.Month(), now.Day()-1, 0, 0, 0, 0, now.Location())
to = time.Date(now.Year(), now.Month(), now.Day()-1, 23, 59, 59, 0, now.Location())