From b79371998fdbf410b82da5a88bf235f4a99fef73 Mon Sep 17 00:00:00 2001 From: yma Date: Tue, 22 Oct 2024 12:01:04 +0800 Subject: [PATCH] Remove one time closed flag since might need to reconnect as necessary --- .../service/tracking/data/cassandra/CassandraClient.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/org/commonjava/indy/service/tracking/data/cassandra/CassandraClient.java b/src/main/java/org/commonjava/indy/service/tracking/data/cassandra/CassandraClient.java index ca2e628..2fb2c52 100644 --- a/src/main/java/org/commonjava/indy/service/tracking/data/cassandra/CassandraClient.java +++ b/src/main/java/org/commonjava/indy/service/tracking/data/cassandra/CassandraClient.java @@ -48,8 +48,6 @@ public class CassandraClient private Cluster cluster; - private volatile boolean closed; - public CassandraClient() { } @@ -118,14 +116,13 @@ public Session getSession( String keyspace ) public void close() { - if ( !closed && cluster != null ) + if ( cluster != null ) { logger.info( "Close cassandra client" ); sessions.forEach( ( key, value ) -> value.close() ); sessions.clear(); cluster.close(); cluster = null; - closed = true; } }