Commit 2eed9410 authored by Michael Ritter's avatar Michael Ritter
Browse files

Remove the collection from the running threads if a validator is not created

parent eb49e0b5
......@@ -63,7 +63,7 @@ public final class AuditTokens extends Thread implements CancelCallback {
new ConcurrentHashMap<>();
// private Map<TokenResponse, Token> tokenMap = new ConcurrentHashMap<TokenResponse, Token>();
private Map<AceToken, MonitoredItem> itemMap =
new ConcurrentHashMap<AceToken, MonitoredItem>();
new ConcurrentHashMap<>();
private static final Logger LOG = Logger.getLogger(AuditTokens.class);
private Collection collection;
private boolean cancel = false;
......@@ -186,7 +186,7 @@ public final class AuditTokens extends Thread implements CancelCallback {
} catch ( Throwable e ) {
LOG.fatal("UNcaught exception in doWork()", e);
} finally {
itemMap.clear(); // free memory in case this gets stuck hianging around
itemMap.clear(); // free memory in case this gets stuck hanging around
}
}
......@@ -235,6 +235,7 @@ public final class AuditTokens extends Thread implements CancelCallback {
TokenValidator validator = openIms();
if ( validator == null ) {
runningThreads.remove(collection);
return;
}
em = PersistUtil.getEntityManager();
......
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