Commit e40a0629 authored by Michael Ritter's avatar Michael Ritter

Reorganize how AuditTokens are finished

parent ce561f53
......@@ -273,15 +273,12 @@ public final class AuditTokens extends Thread implements CancelCallback {
interrupted = true;
} finally {
validator.close();
LOG.trace("Validator closed");
if (em != null) {
em.close();
}
LOG.trace("Validator closed");
synchronized (runningThreads) {
runningThreads.remove(collection);
}
setCollectionState();
if (interrupted) {
em = PersistUtil.getEntityManager();
......@@ -296,6 +293,10 @@ public final class AuditTokens extends Thread implements CancelCallback {
em.close();
LOG.trace("Token Audit ending successfully for " + collection.getName());
}
synchronized (runningThreads) {
runningThreads.remove(collection);
}
}
}
......
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