]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
NOJIRA: Verify es is enabled before attempting to reindex.
authorRay Lee <ray.lee@lyrasis.org>
Sat, 27 Apr 2019 02:56:58 +0000 (19:56 -0700)
committerRay Lee <ray.lee@lyrasis.org>
Sat, 27 Apr 2019 02:56:58 +0000 (19:56 -0700)
services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CSpaceResteasyBootstrap.java

index 2d0ab8e85f9ce704f1ab48a976155cfa9332e9ca..0a8cbc79734cbb33bebedd094487b461c3ce6fe2 100644 (file)
@@ -1,5 +1,7 @@
 package org.collectionspace.services.jaxrs;
 
+import static org.nuxeo.elasticsearch.ElasticSearchConstants.ES_ENABLED_PROPERTY;
+
 import javax.servlet.ServletContextEvent;
 import javax.ws.rs.core.Response;
 
@@ -86,6 +88,12 @@ public class CSpaceResteasyBootstrap extends ResteasyBootstrap {
        }
 
        public void resetElasticSearchIndex() throws Exception {
+               boolean isEnabled = Boolean.parseBoolean(Framework.getProperty(ES_ENABLED_PROPERTY, "true"));
+
+               if (!isEnabled) {
+                       return;
+               }
+
                ElasticSearchComponent es = (ElasticSearchComponent) Framework.getService(ElasticSearchService.class);
 
                for (String repositoryName : es.getRepositoryNames()) {