add more logging to cron

This commit is contained in:
Brad Rydzewski 2020-02-27 14:09:31 -08:00
parent 1ddf7963fe
commit 664da1d436

View file

@ -79,6 +79,8 @@ func (s *Scheduler) run(ctx context.Context) error {
return err
}
logrus.Debugf("cron: found %d pending jobs", len(jobs))
for _, job := range jobs {
// jobs can be manually disabled in the user interface,
// and should be skipped.
@ -162,6 +164,14 @@ func (s *Scheduler) run(ctx context.Context) error {
Sender: commit.Author.Login,
}
logger.WithFields(
logrus.Fields{
"cron": job.Name,
"repo": repo.Slug,
"branch": repo.Branch,
"sha": commit.Sha,
}).Warnln("cron: trigger build")
_, err = s.trigger.Trigger(ctx, repo, hook)
if err != nil {
logger.WithFields(