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

@@ -332,9 +332,6 @@ func (target *AMQPTarget) initAMQP() error {
}
target.conn = conn
if target.store != nil {
streamEventsFromStore(target.store, target, target.quitCh, target.loggerOnce)
}
return nil
}
@@ -349,11 +346,17 @@ func NewAMQPTarget(id string, args AMQPArgs, loggerOnce logger.LogOnce) (*AMQPTa
}
}
return &AMQPTarget{
target := &AMQPTarget{
id: event.TargetID{ID: id, Name: "amqp"},
args: args,
loggerOnce: loggerOnce,
store: store,
quitCh: make(chan struct{}),
}, nil
}
if target.store != nil {
streamEventsFromStore(target.store, target, target.quitCh, target.loggerOnce)
}
return target, nil
}