running job once on start

feature/slack_private_channels
Karolis Rusenas 2018-06-03 12:20:00 +01:00
parent 328e184025
commit dc1d1785cf
1 changed files with 8 additions and 1 deletions

View File

@ -202,6 +202,10 @@ func (w *RepositoryWatcher) addJob(ti *types.TrackedImage, schedule string) erro
"digest": digest,
"schedule": schedule,
}).Info("trigger.poll.RepositoryWatcher: new watch tag digest job added")
// running it now
job.Run()
return w.cron.AddJob(key, schedule, job)
}
@ -213,6 +217,10 @@ func (w *RepositoryWatcher) addJob(ti *types.TrackedImage, schedule string) erro
"digest": digest,
"schedule": schedule,
}).Info("trigger.poll.RepositoryWatcher: new watch repository tags job added")
// running it now
job.Run()
return w.cron.AddJob(key, schedule, job)
}
@ -306,7 +314,6 @@ func (j *WatchRepositoryTagsJob) Run() {
creds := credentialshelper.GetCredentials(j.details.trackedImage)
// reg := j.details.imageRef.Scheme() + "://" + j.details.imageRef.Registry()
reg := j.details.trackedImage.Image.Scheme() + "://" + j.details.trackedImage.Image.Registry()
if j.details.latest == "" {
j.details.latest = j.details.trackedImage.Image.Tag()