From 3d3454a696763f967d05a5a57b178b03f37b259f Mon Sep 17 00:00:00 2001 From: Nicole00 <16240361+Nicole00@users.noreply.github.com> Date: Thu, 17 Jun 2021 10:34:14 +0800 Subject: [PATCH] add close for example --- .../com/vesoft/nebula/examples/StorageClientExample.java | 5 +++++ 1 file changed, 5 insertions(+) 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()) {