diff --git a/examples/src/main/java/com/vesoft/nebula/examples/StorageClientExample.java b/examples/src/main/java/com/vesoft/nebula/examples/StorageClientExample.java index b82b232d4..39cab78c3 100644 --- a/examples/src/main/java/com/vesoft/nebula/examples/StorageClientExample.java +++ b/examples/src/main/java/com/vesoft/nebula/examples/StorageClientExample.java @@ -30,10 +30,13 @@ public static void main(String[] args) { client.connect(); } catch (Exception e) { LOGGER.error("storage client connect error, ", e); + client.close(); System.exit(1); } scanVertex(client); scanEdge(client); + + client.close(); } /** @@ -53,6 +56,7 @@ public static void scanVertex(StorageClient client) { result = iterator.next(); } catch (Exception e) { LOGGER.error("scan error, ", e); + client.close(); System.exit(1); } if (result.isEmpty()) { @@ -99,6 +103,7 @@ public static void scanEdge(StorageClient client) { result = iterator.next(); } catch (Exception e) { LOGGER.error("scan error, ", e); + client.close(); System.exit(1); } if (result.isEmpty()) {