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

@@ -244,9 +244,6 @@ func (target *NSQTarget) initNSQ() error {
return errNotConnected
}
if target.store != nil {
streamEventsFromStore(target.store, target, target.quitCh, target.loggerOnce)
}
return nil
}
@@ -261,11 +258,17 @@ func NewNSQTarget(id string, args NSQArgs, loggerOnce logger.LogOnce) (*NSQTarge
}
}
return &NSQTarget{
target := &NSQTarget{
id: event.TargetID{ID: id, Name: "nsq"},
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
}