Add option to skip notification at the very first analysis of an image (#10)

This commit is contained in:
CrazyMax
2019-12-22 16:32:27 +01:00
parent b288673a33
commit 7a8b4677fc
10 changed files with 51 additions and 9 deletions

View File

@@ -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,