Skip to content

Commit

Permalink
renamed variable to avoid double negation
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin <[email protected]>
  • Loading branch information
KPostOffice authored and openshift-merge-robot committed Aug 26, 2023
1 parent 59bab13 commit f05c6a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/queuejob/queuejob_controller_ex.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,9 @@ func (qjm *XController) GetQueueJobsEligibleForPreemption() []*arbv1.AppWrapper
awDispatchDurationLimit := value.Spec.SchedSpec.DispatchDuration.Limit
dispatchDuration := value.Status.ControllerFirstDispatchTimestamp.Add(time.Duration(awDispatchDurationLimit) * time.Second)
currentTime := time.Now()
hasDispatchTimeNotExceeded := currentTime.Before(dispatchDuration)
dispatchTimeExceeded := !currentTime.Before(dispatchDuration)

if !hasDispatchTimeNotExceeded {
if dispatchTimeExceeded {
klog.V(8).Infof("Appwrapper Dispatch limit exceeded, currentTime %v, dispatchTimeInSeconds %v", currentTime, dispatchDuration)
value.Spec.SchedSpec.DispatchDuration.Overrun = true
qjobs = append(qjobs, value)
Expand Down

0 comments on commit f05c6a8

Please sign in to comment.