Run aggregator on the server

This commit is contained in:
Ken Hibino
2022-03-10 12:15:28 -08:00
parent 4b35eb0e1a
commit 196db64d4d
2 changed files with 48 additions and 6 deletions

View File

@@ -82,12 +82,18 @@ func newAggregator(params aggregatorParams) *aggregator {
}
func (a *aggregator) shutdown() {
if a.aggregateFunc == nil {
return
}
a.logger.Debug("Aggregator shutting down...")
// Signal the aggregator goroutine to stop.
a.done <- struct{}{}
}
func (a *aggregator) start(wg *sync.WaitGroup) {
if a.aggregateFunc == nil {
return
}
wg.Add(1)
go func() {
defer wg.Done()