mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 07:56:16 +00:00
Bypass ingest if server not started
This commit is contained in:
parent
3f11338014
commit
be021e3f14
@ -35,6 +35,7 @@ import org.sleuthkit.autopsy.casemodule.Case;
|
||||
public class Installer extends ModuleInstall {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Installer.class.getName());
|
||||
private final static int SERVER_START_RETRIES = 5;
|
||||
|
||||
@Override
|
||||
public void restored() {
|
||||
@ -68,7 +69,7 @@ public class Installer extends ModuleInstall {
|
||||
}
|
||||
|
||||
//retry if needed
|
||||
int retries = 5;
|
||||
int retries = SERVER_START_RETRIES;
|
||||
while (retries-- > 0) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
|
@ -38,6 +38,7 @@ import org.apache.solr.client.solrj.SolrServerException;
|
||||
import org.netbeans.api.progress.ProgressHandle;
|
||||
import org.netbeans.api.progress.ProgressHandleFactory;
|
||||
import org.openide.util.Cancellable;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||
import org.sleuthkit.autopsy.coreutils.StopWatch;
|
||||
@ -339,10 +340,19 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
|
||||
|
||||
ingester = Server.getIngester();
|
||||
|
||||
//use the settings files to set values
|
||||
|
||||
|
||||
final Server server = KeywordSearch.getServer();
|
||||
try {
|
||||
if (! server.isRunning()) {
|
||||
String msg = "Keyword search server was not properly initialized, cannot run keyword search ingest. ";
|
||||
logger.log(Level.SEVERE, msg);
|
||||
String details = msg + "Please try restarting the OS and the application";
|
||||
services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details));
|
||||
return;
|
||||
|
||||
}
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Error checking if Solr server is running while initializing ingest", ex);
|
||||
}
|
||||
|
||||
|
||||
//initialize extractors
|
||||
|
@ -327,7 +327,7 @@ class Server {
|
||||
// that doesn't work when there are no cores
|
||||
|
||||
CoreAdminRequest.getStatus(null, solrServer);
|
||||
logger.log(Level.INFO, "Solr is running");
|
||||
logger.log(Level.INFO, "Solr server is running");
|
||||
} catch (SolrServerException ex) {
|
||||
|
||||
Throwable cause = ex.getRootCause();
|
||||
@ -336,7 +336,7 @@ class Server {
|
||||
// probably caused by starting a connection as the server finishes
|
||||
// shutting down)
|
||||
if (cause instanceof ConnectException || cause instanceof SocketException || cause instanceof NoHttpResponseException) {
|
||||
logger.log(Level.INFO, "Solr is not running, cause: " + cause.getMessage());
|
||||
logger.log(Level.INFO, "Solr server is not running, cause: " + cause.getMessage());
|
||||
return false;
|
||||
} else {
|
||||
throw new KeywordSearchModuleException("Error checking if Solr server is running", ex);
|
||||
|
Loading…
x
Reference in New Issue
Block a user