fix skit flush when using cluster runner
@@ -629,12 +629,14 @@ public class FessEsClient implements Client {
@Override
@PreDestroy
public void close() {
+ if (runner != null) {
try {
client.admin().indices().prepareFlush().setForce(true).execute()
.actionGet(ComponentUtil.getFessConfig().getIndexIndicesTimeout());
} catch (final Exception e) {
logger.warn("Failed to flush indices.", e);
}
+ }
try {
client.close();
} catch (final ElasticsearchException e) {
