Commit 5a7c41f0 authored by Michael Ritter's avatar Michael Ritter
Browse files

Update items if an audit fails; log the type of audit failure

parent 68528448
...@@ -348,7 +348,6 @@ public final class AuditThread extends Thread implements CancelCallback { ...@@ -348,7 +348,6 @@ public final class AuditThread extends Thread implements CancelCallback {
private void performAudit() { private void performAudit() {
// 1. Setup audit // 1. Setup audit
//TODO Clean up filtering creation
PathFilter filter = new SimpleFilter(coll); PathFilter filter = new SimpleFilter(coll);
Date startDate = new Date(); Date startDate = new Date();
...@@ -400,6 +399,10 @@ public final class AuditThread extends Thread implements CancelCallback { ...@@ -400,6 +399,10 @@ public final class AuditThread extends Thread implements CancelCallback {
iterableItems.cancel(); iterableItems.cancel();
} }
// 4. Clean up, set local inactive
lastFileSeen = "looking for missed items";
setInactiveBefore(startDate);
if (cancel || abortException != null) { if (cancel || abortException != null) {
return; return;
} }
...@@ -412,14 +415,9 @@ public final class AuditThread extends Thread implements CancelCallback { ...@@ -412,14 +415,9 @@ public final class AuditThread extends Thread implements CancelCallback {
batch = null; batch = null;
} }
// 4. Clean up, set local inactive
lastFileSeen = "looking for missed items";
setInactiveBefore(startDate);
// harvest remote collections // harvest remote collections
lastFileSeen = "comparing to peer sites"; lastFileSeen = "comparing to peer sites";
compareToPeers(); compareToPeers();
} }
private void generateAuditReport() { private void generateAuditReport() {
...@@ -451,7 +449,7 @@ public final class AuditThread extends Thread implements CancelCallback { ...@@ -451,7 +449,7 @@ public final class AuditThread extends Thread implements CancelCallback {
if (abortException instanceof InterruptedException if (abortException instanceof InterruptedException
|| abortException.getCause() instanceof InterruptedException) { || abortException.getCause() instanceof InterruptedException) {
LOG.trace("Audit ending with Interrupt"); LOG.trace("Audit ending with Interrupt");
logManager.persistCollectionEvent(LogEnum.FILE_AUDIT_FINISH, logManager.persistCollectionEvent(LogEnum.FILE_AUDIT_ABORT,
"Audit Interrupted", em); "Audit Interrupted", em);
} else { } else {
LOG.error("Uncaught exception in audit thread", abortException); LOG.error("Uncaught exception in audit thread", abortException);
...@@ -459,12 +457,12 @@ public final class AuditThread extends Thread implements CancelCallback { ...@@ -459,12 +457,12 @@ public final class AuditThread extends Thread implements CancelCallback {
String message = Strings.exceptionAsString(abortException); String message = Strings.exceptionAsString(abortException);
logManager.persistCollectionEvent( logManager.persistCollectionEvent(
LogEnum.SYSTEM_ERROR, message, em); LogEnum.SYSTEM_ERROR, message, em);
logManager.persistCollectionEvent(LogEnum.FILE_AUDIT_FINISH, logManager.persistCollectionEvent(LogEnum.FILE_AUDIT_ABORT,
"Uncaught audit thread exception ", em); "Uncaught audit thread exception ", em);
} }
} else if (cancel) { } else if (cancel) {
logManager.persistCollectionEvent(LogEnum.FILE_AUDIT_FINISH, logManager.persistCollectionEvent(LogEnum.FILE_AUDIT_CANCEL,
"Audit interrupted by user or token registration", em); "Audit interrupted by user or token registration", em);
LOG.trace("Audit ending on cancel request"); LOG.trace("Audit ending on cancel request");
} else { } else {
...@@ -746,7 +744,7 @@ public final class AuditThread extends Thread implements CancelCallback { ...@@ -746,7 +744,7 @@ public final class AuditThread extends Thread implements CancelCallback {
} }
private void setInactiveBefore(Date d) { private void setInactiveBefore(Date d) {
if (baseItemPathList != null || cancel || abortException != null) { if (baseItemPathList != null) {
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment