mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 11:38:02 +00:00
Add lock and close check on cassandra as well
This commit is contained in:
@@ -116,12 +116,15 @@ func (c *cassandraConnectionProducer) Initialize(ctx context.Context, conf map[s
|
||||
}
|
||||
|
||||
func (c *cassandraConnectionProducer) Connection(_ context.Context) (interface{}, error) {
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
|
||||
if !c.Initialized {
|
||||
return nil, connutil.ErrNotInitialized
|
||||
}
|
||||
|
||||
// If we already have a DB, return it
|
||||
if c.session != nil {
|
||||
if c.session != nil && !c.session.Closed() {
|
||||
return c.session, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user