Skip to content

Commit

Permalink
FIX-NOTIFICATION-TS: Fixing the time interval for notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
varunsharma0286 authored and gnmahanth committed Jan 25, 2024
1 parent 684664c commit 29afed2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deepfence_worker/cronjobs/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"github.com/hibiken/asynq"
)

const NOTIFICATION_INTERVAL = 60000 //in milliseconds

var fieldsMap = map[string]map[string]string{utils.ScanTypeDetectedNode[utils.NEO4JVulnerabilityScan]: {
"cve_severity": "Severity",
"cve_id": "CVE Id",
Expand Down Expand Up @@ -287,7 +289,7 @@ func processIntegration[T any](ctx context.Context, task *asynq.Task, integratio
return err
}

last30sTimeStamp := ts - 30000
last30sTimeStamp := ts - NOTIFICATION_INTERVAL

log.Debug().Msgf("Check for %s scans to notify at timestamp (%d,%d)",
integrationRow.Resource, last30sTimeStamp, ts)
Expand Down

0 comments on commit 29afed2

Please sign in to comment.