From f7cadf87744f6a6ec0757ecbee460a2e0828f986 Mon Sep 17 00:00:00 2001 From: Terry W Brady Date: Tue, 31 Jan 2017 15:02:55 -0800 Subject: [PATCH] Initialize solr shards at first stats post Make it more likely that the shards are awake on first use --- .../java/org/dspace/statistics/SolrLoggerServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dspace-api/src/main/java/org/dspace/statistics/SolrLoggerServiceImpl.java b/dspace-api/src/main/java/org/dspace/statistics/SolrLoggerServiceImpl.java index cc1b9ee6fd..4beb20f066 100644 --- a/dspace-api/src/main/java/org/dspace/statistics/SolrLoggerServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/statistics/SolrLoggerServiceImpl.java @@ -181,6 +181,7 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea { return; } + initSolrYearCores(); try @@ -220,6 +221,7 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea if (solr == null || locationService == null) { return; } + initSolrYearCores(); try { SolrInputDocument doc1 = getCommonSolrDoc(dspaceObject, ip, userAgent, xforwardedfor, @@ -445,6 +447,7 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea { SolrInputDocument solrDoc = getCommonSolrDoc(resultObject, request, currentUser); if (solrDoc == null) return; + initSolrYearCores(); for (String query : queries) { solrDoc.addField("query", query); @@ -491,6 +494,7 @@ public class SolrLoggerServiceImpl implements SolrLoggerService, InitializingBea @Override public void postWorkflow(UsageWorkflowEvent usageWorkflowEvent) throws SQLException { + initSolrYearCores(); try { SolrInputDocument solrDoc = getCommonSolrDoc(usageWorkflowEvent.getObject(), null, null);