Skip to content

Commit

Permalink
Fixed min/max operations in ComputerRetentionWork
Browse files Browse the repository at this point in the history
As previously implemented, nextCheck would always happen in 1 minute, regardless
of what the RetentionStrategy.check() returned.
  • Loading branch information
Bernie Schelberg committed Jan 6, 2015
1 parent 4470b9e commit e00f992
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected void doRun() {
if (!nextCheck.containsKey(c) || startRun > nextCheck.get(c)) {
// at the moment I don't trust strategies to wait more than 60 minutes
// strategies need to wait at least one minute
final long waitInMins = Math.min(1, Math.max(60, c.getRetentionStrategy().check(c)));
final long waitInMins = Math.max(1, Math.min(60, c.getRetentionStrategy().check(c)));
nextCheck.put(c, startRun + waitInMins*1000*60 /*MINS->MILLIS*/);
}
}
Expand Down

0 comments on commit e00f992

Please sign in to comment.