Prevent deadlock inside *els Connect

This commit is contained in:
ionutboangiu
2024-11-15 18:50:38 +02:00
committed by Dan Christian Bogos
parent a05834af81
commit 5bd439020c

View File

@@ -161,12 +161,12 @@ func (eEe *ElasticEE) Cfg() *config.EventExporterCfg { return eEe.cfg }
func (eEe *ElasticEE) Connect() (err error) {
eEe.Lock()
defer eEe.Unlock()
// create the client
if eEe.eClnt != nil {
return
}
eEe.eClnt, err = elasticsearch.NewClient(eEe.clntOpts)
eEe.Unlock()
return
}