mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-24 22:39:22 +01:00
Add option to skip notification at the very first analysis of an image (#10)
This commit is contained in:
@@ -28,6 +28,13 @@ func (di *Diun) createJob(job model.Job) {
|
||||
return
|
||||
}
|
||||
|
||||
// First check?
|
||||
job.FirstCheck, err = di.db.First(job.RegImage)
|
||||
if err != nil {
|
||||
sublog.Error().Err(err).Msg("Cannot check first")
|
||||
return
|
||||
}
|
||||
|
||||
// Registry options
|
||||
regOpts, err := di.getRegOpts(job.Image.RegOptsID)
|
||||
if err != nil {
|
||||
@@ -166,6 +173,11 @@ func (di *Diun) runJob(job model.Job) error {
|
||||
}
|
||||
sublog.Debug().Msg("Manifest saved to database")
|
||||
|
||||
if job.FirstCheck && !di.cfg.Watch.FirstCheckNotif {
|
||||
sublog.Debug().Msg("Skipping notification (first check)")
|
||||
return nil
|
||||
}
|
||||
|
||||
di.notif.Send(model.NotifEntry{
|
||||
Status: status,
|
||||
Provider: job.Provider,
|
||||
|
||||
Reference in New Issue
Block a user