only check unprocessed events from last 1 day
Some checks are pending
CI / Test (push) Waiting to run
CI / End-to-End (push) Waiting to run
CI / Publish Docker (push) Blocked by required conditions
CI / Lint (push) Waiting to run
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-25 12:55:13 +10:00
parent 47bc8acace
commit c7c890f6bb
3 changed files with 8 additions and 4 deletions

View File

@@ -31,10 +31,12 @@ func (c *CronTask) RunVmCheck(ctx context.Context, logger *slog.Logger) error {
folderPath string
)
logger.Debug("Started Events processing", "time", time.Now())
dateCmp := time.Now().AddDate(0, 0, -1).Unix()
logger.Debug("Started Events processing", "time", time.Now(), "since", dateCmp)
// Query events table
events, err := c.Database.Queries().ListUnprocessedEvents(ctx)
events, err := c.Database.Queries().ListUnprocessedEvents(ctx,
sql.NullInt64{Int64: dateCmp, Valid: dateCmp > 0})
if err != nil {
logger.Error("Unable to query for unprocessed events", "error", err)
return nil // TODO - what to do with this error?