feat: add close method for Cassandra (#2961)

Signed-off-by: Alexandre Liberato <alexandreliberato@mailfence.com>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
This commit is contained in:
Alexandre 2023-07-01 19:00:19 +00:00 committed by GitHub
parent 5adc33d079
commit c62e7c9ad7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -326,3 +326,14 @@ func (c *Cassandra) GetComponentMetadata() map[string]string {
metadata.GetMetadataInfoFromStructType(reflect.TypeOf(metadataStruct), &metadataInfo, metadata.StateStoreType)
return metadataInfo
}
// Close the connection to Cassandra.
func (c *Cassandra) Close() error {
if c.session == nil {
return nil
}
c.session.Close()
return nil
}