Skip to content

Commit

Permalink
Remove one time closed flag since might need to reconnect as necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
yma96 committed Oct 22, 2024
1 parent 1247339 commit b793719
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ public class CassandraClient

private Cluster cluster;

private volatile boolean closed;

public CassandraClient()
{
}
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit b793719

Please sign in to comment.