!72 fix: close index file after read

Merge pull request !72 from tushengxia/fix-hindex-inputstream
This commit is contained in:
i-robot 2020-07-21 04:09:40 +08:00 committed by Gitee
commit 8fa746ef0d
1 changed files with 3 additions and 3 deletions

View File

@ -215,9 +215,9 @@ public class IndexClient
| NoSuchMethodException e) {
throw new IOException(e);
}
try (InputStream is = indexStore.read(child)) {
index.load(is);
}
InputStream is = indexStore.read(child);
index.load(is);
is.close();
LOG.debug("Loaded {} index from {}.", index.getId(), child);
result.put(child, index);
}