mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
audit/kafka: Fix quitting early after first logging (#14932)
A recent commit created some regressions: - Kafka/Audit goroutines quit when the first log is sent - Missing doneCh initialization in Kafka audit
This commit is contained in:
parent
040ac5cad8
commit
e952e2a691
@ -179,11 +179,13 @@ func (h *Target) startHTTPLogger() {
|
||||
go func() {
|
||||
defer h.wg.Done()
|
||||
|
||||
select {
|
||||
case entry := <-h.logCh:
|
||||
h.logEntry(entry)
|
||||
case <-h.doneCh:
|
||||
return
|
||||
for {
|
||||
select {
|
||||
case entry := <-h.logCh:
|
||||
h.logEntry(entry)
|
||||
case <-h.doneCh:
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
@ -96,11 +96,13 @@ func (h *Target) startKakfaLogger() {
|
||||
go func() {
|
||||
defer h.wg.Done()
|
||||
|
||||
select {
|
||||
case entry := <-h.logCh:
|
||||
h.logEntry(entry)
|
||||
case <-h.doneCh:
|
||||
return
|
||||
for {
|
||||
select {
|
||||
case entry := <-h.logCh:
|
||||
h.logEntry(entry)
|
||||
case <-h.doneCh:
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
@ -230,6 +232,7 @@ func (h *Target) Cancel() {
|
||||
func New(config Config) *Target {
|
||||
target := &Target{
|
||||
logCh: make(chan interface{}, 10000),
|
||||
doneCh: make(chan struct{}),
|
||||
kconfig: config,
|
||||
}
|
||||
return target
|
||||
|
Loading…
Reference in New Issue
Block a user