Skip to content

Commit

Permalink
Reverse the Stop order
Browse files Browse the repository at this point in the history
  • Loading branch information
codebien committed May 24, 2023
1 parent 30b995c commit 134ce0f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions output/cloud/expv2/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ func (o *Output) Start() error {
// StopWithTestError gracefully stops all metric emission from the output.
func (o *Output) StopWithTestError(testErr error) error {
o.logger.Debug("Stopping...")

close(o.stopMetricsCollection)
o.periodicCollector.Stop()

o.collector.SetNoDelayOnFlush()
o.periodicCollector.Stop()
o.periodicFlusher.Stop()
o.collector.CollectSamples(nil)

o.periodicFlusher.Stop()
o.logger.Debug("Stopped!")
return nil
}
Expand Down

0 comments on commit 134ce0f

Please sign in to comment.