Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

fix: Add function to stop the defaultWorker #1272

Merged
merged 2 commits into from
Feb 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions stats/view/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ func SetReportingPeriod(d time.Duration) {
defaultWorker.SetReportingPeriod(d)
}

// Stop stops the default worker.
func Stop() {
defaultWorker.Stop()
}

// SetReportingPeriod sets the interval between reporting aggregated views in
// the program. If duration is less than or equal to zero, it enables the
// default behavior.
Expand Down