Skip to content

Commit

Permalink
Merge pull request #95 from seaneagan/fix-requeue-duration-log
Browse files Browse the repository at this point in the history
Fix logging for next run delay
  • Loading branch information
seaneagan authored Sep 28, 2020
2 parents 9b1c951 + 30a8f93 commit a6e8e3d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions controllers/helmrelease_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ func (r *HelmReleaseReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)
}

// Log reconciliation duration
log.Info(fmt.Sprintf("reconcilation finished in %s, next run in %s",
time.Now().Sub(start).String(),
hr.Spec.Interval.Duration.String(),
))
durationMsg := fmt.Sprintf("reconcilation finished in %s", time.Now().Sub(start).String())
if result.RequeueAfter > 0 {
durationMsg = fmt.Sprintf("%s, next run in %s", durationMsg, result.RequeueAfter.String())
}
log.Info(durationMsg)

return result, err
}
Expand Down

0 comments on commit a6e8e3d

Please sign in to comment.