fix noisy logs (#1701)

This commit is contained in:
Ken Stevens 2020-02-04 11:29:09 -05:00 committed by GitHub
parent 4989361922
commit da54d3443e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 10 deletions

View File

@ -163,8 +163,7 @@ public class DatabaseSearchCacheSvcImpl implements ISearchCacheSvc {
ourLog.info("Searching for searches which are before {} - now is {}", new InstantType(cutoff), new InstantType(new Date(now())));
}
// FIXME KHS
ourLog.info("Searching for searches which are before {}", cutoff);
ourLog.debug("Searching for searches which are before {}", cutoff);
TransactionTemplate tt = new TransactionTemplate(myTxManager);
final Slice<Long> toDelete = tt.execute(theStatus ->
@ -173,9 +172,7 @@ public class DatabaseSearchCacheSvcImpl implements ISearchCacheSvc {
assert toDelete != null;
for (final Long nextSearchToDelete : toDelete) {
// FIXME KHS
ourLog.info("Deleting search with PID {}", nextSearchToDelete);
// FIXME KHS do this outside of loop. Make a "deleteWhereCreatedBefore"
ourLog.debug("Deleting search with PID {}", nextSearchToDelete);
tt.execute(t -> {
mySearchDao.updateDeleted(nextSearchToDelete, true);
return null;
@ -189,12 +186,9 @@ public class DatabaseSearchCacheSvcImpl implements ISearchCacheSvc {
int count = toDelete.getContent().size();
if (count > 0) {
// FIXME KHS
// if (ourLog.isDebugEnabled() || "true".equalsIgnoreCase(System.getProperty("test"))) {
if ( "true".equalsIgnoreCase(System.getProperty("test"))) {
if (ourLog.isDebugEnabled() || "true".equalsIgnoreCase(System.getProperty("test"))) {
Long total = tt.execute(t -> mySearchDao.count());
// FIXME KHS
ourLog.info("Deleted {} searches, {} remaining", count, total);
ourLog.debug("Deleted {} searches, {} remaining", count, total);
}
}
}