mirror of
https://github.com/minio/minio.git
synced 2025-11-25 20:16:10 -05:00
This PR fixes two things (#8772)
- Stop spawning store replay routines when testing the notification targets - Properly honor the target.Close() to clean the resources used Fixes #8707 Co-authored-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
committed by
Nitish Tiwari
parent
c2cde6beb5
commit
4cd1bbb50a
@@ -243,13 +243,13 @@ func (target *RedisTarget) Send(eventKey string) error {
|
||||
return target.store.Del(eventKey)
|
||||
}
|
||||
|
||||
// Close - does nothing and available for interface compatibility.
|
||||
// Close - releases the resources used by the pool.
|
||||
func (target *RedisTarget) Close() error {
|
||||
return nil
|
||||
return target.pool.Close()
|
||||
}
|
||||
|
||||
// NewRedisTarget - creates new Redis target.
|
||||
func NewRedisTarget(id string, args RedisArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}, errKind ...interface{})) (*RedisTarget, error) {
|
||||
func NewRedisTarget(id string, args RedisArgs, doneCh <-chan struct{}, loggerOnce func(ctx context.Context, err error, id interface{}, errKind ...interface{}), test bool) (*RedisTarget, error) {
|
||||
pool := &redis.Pool{
|
||||
MaxIdle: 3,
|
||||
IdleTimeout: 2 * 60 * time.Second,
|
||||
@@ -314,7 +314,7 @@ func NewRedisTarget(id string, args RedisArgs, doneCh <-chan struct{}, loggerOnc
|
||||
target.firstPing = true
|
||||
}
|
||||
|
||||
if target.store != nil {
|
||||
if target.store != nil && !test {
|
||||
// Replays the events from the store.
|
||||
eventKeyCh := replayEvents(target.store, doneCh, loggerOnce, target.ID())
|
||||
// Start replaying events from the store.
|
||||
|
||||
Reference in New Issue
Block a user