fix keyword search timer reset - can't resuse the old timer object

This commit is contained in:
adam-m 2012-11-19 15:30:17 -05:00
parent 06a9d47251
commit 20320eb2f4

View File

@ -811,7 +811,12 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
@Override
protected Object doInBackground() throws Exception {
logger.log(Level.INFO, "Pending start of new searcher");
if (finalRun) {
logger.log(Level.INFO, "Pending start of new (final) searcher");
}
else {
logger.log(Level.INFO, "Pending start of new searcher");
}
final String displayName = "Keyword Search" + (finalRun ? " - Finalizing" : "");
progress = ProgressHandleFactory.createHandle(displayName + (" (Pending)"), new Cancellable() {
@ -1082,7 +1087,10 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
} else {
//start counting time for a new searcher to start
//unless final searcher is pending
if (finalSearcher != null) {
if (finalSearcher == null) {
//we need a new Timer object, because restarting previus will not cause firing of the action
final int updateIntervalMs = KeywordSearchSettings.getUpdateFrequency().getTime() * 60 * 1000;
searchTimer = new Timer(updateIntervalMs, new SearchTimerAction());
searchTimer.start();
}
}