fix #1507 skit flush when using cluster runner
This commit is contained in:
parent
dd5ed5a4c0
commit
ce4ddda567
1 changed files with 7 additions and 5 deletions
|
@ -629,11 +629,13 @@ public class FessEsClient implements Client {
|
|||
@Override
|
||||
@PreDestroy
|
||||
public void close() {
|
||||
try {
|
||||
client.admin().indices().prepareFlush().setForce(true).execute()
|
||||
.actionGet(ComponentUtil.getFessConfig().getIndexIndicesTimeout());
|
||||
} catch (final Exception e) {
|
||||
logger.warn("Failed to flush indices.", e);
|
||||
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();
|
||||
|
|
Loading…
Add table
Reference in a new issue