From 9c09bba6e6ff098c7c78bd1c618c1cde8bad9813 Mon Sep 17 00:00:00 2001 From: esaunders Date: Wed, 14 Jun 2017 13:54:14 -0400 Subject: [PATCH] Added isEnabled workaround to shutdown() method so that it doesn't attempt to interact with the database if the module is not run. --- .../ingestmodule/IngestModule.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/enterpriseartifactmanager/ingestmodule/IngestModule.java b/Experimental/src/org/sleuthkit/autopsy/experimental/enterpriseartifactmanager/ingestmodule/IngestModule.java index 04ace8dbb3..8a5b74bd46 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/enterpriseartifactmanager/ingestmodule/IngestModule.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/enterpriseartifactmanager/ingestmodule/IngestModule.java @@ -152,6 +152,17 @@ class IngestModule implements FileIngestModule { @Override public void shutDown() { + if (Boolean.parseBoolean(ModuleSettings.getConfigSetting("EnterpriseArtifactManager", "db.enabled")) == false + || EamDb.getInstance().isEnabled() == false) { + /* + * Not signaling an error for now. This is a workaround for the way + * all newly didscovered ingest modules are automatically anabled. + * + * TODO (JIRA-2731): Add isEnabled API for ingest modules. + */ + return; + } + EamDb dbManager = EamDb.getInstance(); try { dbManager.bulkInsertArtifacts();