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 e48eb5df13
commit d5aa567e98

View File

@@ -160,12 +160,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.clnOpts)
eEe.Unlock()
return
}