@@ -186,7 +186,8 @@ public void init(final Collection<NamedIndexDir> luceneIndexes) {
186
186
submitInitIfIndexExists (executor , indexDir );
187
187
}
188
188
189
- shutdownAndAwaitTermination (executor , start , "Suggester successfully initialized" );
189
+ shutdownAndAwaitTermination (executor , start , suggesterInitTimer ,
190
+ "Suggester successfully initialized" );
190
191
initDone .countDown ();
191
192
}
192
193
}
@@ -251,12 +252,13 @@ private boolean indexExists(final Path indexDir) throws IOException {
251
252
}
252
253
253
254
private void shutdownAndAwaitTermination (final ExecutorService executorService , Instant start ,
255
+ Timer timer ,
254
256
final String logMessageOnSuccess ) {
255
257
executorService .shutdown ();
256
258
try {
257
259
executorService .awaitTermination (awaitTerminationTime .toMillis (), TimeUnit .MILLISECONDS );
258
260
Duration duration = Duration .between (start , Instant .now ());
259
- suggesterInitTimer .record (duration );
261
+ timer .record (duration );
260
262
logger .log (Level .INFO , "{0} (took {1})" , new Object []{logMessageOnSuccess ,
261
263
DurationFormatUtils .formatDurationWords (duration .toMillis (),
262
264
true , true )});
@@ -296,7 +298,7 @@ public void rebuild(final Collection<NamedIndexDir> indexDirs) {
296
298
}
297
299
}
298
300
299
- shutdownAndAwaitTermination (executor , start ,
301
+ shutdownAndAwaitTermination (executor , start , suggesterRebuildTimer ,
300
302
"Suggesters for " + indexDirs + " were successfully rebuilt" );
301
303
}
302
304
0 commit comments