move flags to finally block

This commit is contained in:
Shinsuke Sugaya 2016-04-06 22:55:42 +09:00
parent e955e246ea
commit 84ebfcbdce

View file

@ -220,6 +220,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) {
@ -236,8 +245,6 @@ public class DataIndexHelper implements Serializable {
deleteOldDocs();
}
}
running = false;
finished = true;
}
private void deleteOldDocs() {