BasicDBObject query = new BasicDBObject();
query.put(TRIGGER_NEXT_FIRE_TIME, new BasicDBObject("$lte", new Date(noLaterThan)));
if (log.isDebugEnabled()) {
log.debug("Finding up to " + maxCount + " triggers which have time less than " + new Date(noLaterThan));
}
Do this:-
Date noLaterThanDate = new Date();
BasicDBObject query = new BasicDBObject();
query.put(TRIGGER_NEXT_FIRE_TIME, new BasicDBObject("$lte", noLaterThanDate));
log.debug("Finding up to {} triggers which have time less than {}", maxCount, noLaterThanDate);
i.e. you don't really need those isDebugEnabled calls if you are using the SLF4j eith {} instead of string concatenation.
... And only create the noLaterThanDate once rather than twice as it was prior.
Don't do this:-
Do this:-
i.e. you don't really need those isDebugEnabled calls if you are using the SLF4j eith {} instead of string concatenation.
... And only create the noLaterThanDate once rather than twice as it was prior.