Skip to content

Commit

Permalink
cleanup: use time.Until() for calculating next reconsile run
Browse files Browse the repository at this point in the history
Signed-off-by: Niels de Vos <[email protected]>
  • Loading branch information
nixpanic authored and mergify[bot] committed Jun 12, 2023
1 parent e2d98b2 commit eea70e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/csiaddons/reclaimspacecronjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (r *ReclaimSpaceCronJobReconciler) Reconcile(ctx context.Context, req ctrl.

// We'll prep our eventual request to requeue until the next job, and then figure
// out if we actually need to run.
scheduledResult := ctrl.Result{RequeueAfter: nextRun.Sub(time.Now())} // save this so we can re-use it elsewhere
scheduledResult := ctrl.Result{RequeueAfter: time.Until(nextRun)} // save this so we can re-use it elsewhere
logger = logger.WithValues("now", time.Now(), "nextRun", nextRun)

// If we've missed a run, and we're still within the deadline to start it, we'll need to run a job.
Expand Down

0 comments on commit eea70e1

Please sign in to comment.