Skip to content

Commit

Permalink
fix(notifier): Adding log for debugging broken auto-update
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <bob@vibioh.fr>
  • Loading branch information
ViBiOh committed Oct 12, 2021
1 parent 0ae09a6 commit 53df8bc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/notifier/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (a App) syncReleasesByUser(releases []model.Release, ketchups []model.Ketch
current := ketchups[index]

if release.Repository.ID < current.Repository.ID || (release.Repository.ID == current.Repository.ID && release.Pattern < current.Pattern) {
break // release is out of sync, we need to go foward release
break // release is out of sync, we need to go forward release
}

index++
Expand All @@ -200,8 +200,11 @@ func (a App) syncReleasesByUser(releases []model.Release, ketchups []model.Ketch
}

if current.UpdateWhenNotify {
log := logger.WithField("repository", current.Repository.ID).WithField("user", current.User.ID).WithField("pattern", current.Pattern)

log.Info("Auto-updating ketchup to %s", release.Version.Name)
if err := a.ketchupService.UpdateVersion(context.Background(), current.Repository.ID, current.User.ID, current.Pattern, release.Version.Name); err != nil {
logger.Error("unable to update ketchup user=%d repository=%d: %s", current.User.ID, current.Repository.ID, err)
log.Error("unable to update ketchup version: %s", err)
}
}
}
Expand Down

0 comments on commit 53df8bc

Please sign in to comment.