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