move flags to finally block

This commit is contained in:
Shinsuke Sugaya 2016-04-07 08:16:53 +09:00
parent 6d36baa952
commit d5ee67e99b

View file

@ -226,6 +226,15 @@ public class DataIndexHelper implements Serializable {
@Override
public void run() {
running = true;
try {
process();
} finally {
running = false;
finished = true;
}
}
protected void process() {
final DataStoreFactory dataStoreFactory = ComponentUtil.getDataStoreFactory();
dataStore = dataStoreFactory.getDataStore(dataConfig.getHandlerName());
if (dataStore == null) {
@ -242,8 +251,6 @@ public class DataIndexHelper implements Serializable {
deleteOldDocs();
}
}
running = false;
finished = true;
}
private void deleteOldDocs() {