fix: a possible crash in event target Close() (#17948)

these are possible crashes when the configured
target is still in init() state and never finished
- however a delete config was initiated.
This commit is contained in:
Harshavardhana
2023-08-30 07:27:45 -07:00
committed by GitHub
parent b48bbe08b2
commit 0d1fbef751
4 changed files with 17 additions and 4 deletions
+4 -1
View File
@@ -273,7 +273,10 @@ func (target *RedisTarget) SendFromStore(eventKey string) error {
// Close - releases the resources used by the pool.
func (target *RedisTarget) Close() error {
close(target.quitCh)
return target.pool.Close()
if target.pool != nil {
return target.pool.Close()
}
return nil
}
func (target *RedisTarget) init() error {