initialize streaming events without lazy initialization (#16016)

This commit is contained in:
Harshavardhana
2022-11-07 08:01:24 -08:00
committed by GitHub
parent 1f3db03bf0
commit 21251d8c22
10 changed files with 81 additions and 51 deletions

View File

@@ -296,9 +296,6 @@ func (target *RedisTarget) initRedis() error {
return errNotConnected
}
if target.store != nil {
streamEventsFromStore(target.store, target, target.quitCh, target.loggerOnce)
}
return nil
}
@@ -343,12 +340,18 @@ func NewRedisTarget(id string, args RedisArgs, loggerOnce logger.LogOnce) (*Redi
},
}
return &RedisTarget{
target := &RedisTarget{
id: event.TargetID{ID: id, Name: "redis"},
args: args,
pool: pool,
store: store,
loggerOnce: loggerOnce,
quitCh: make(chan struct{}),
}, nil
}
if target.store != nil {
streamEventsFromStore(target.store, target, target.quitCh, target.loggerOnce)
}
return target, nil
}