Skip to content

Commit

Permalink
Merge pull request #71 from draganm/stop-service-ticker
Browse files Browse the repository at this point in the history
stop refreshTicker on context cancel in http/service.go
  • Loading branch information
mcdee authored Aug 14, 2023
2 parents 912094d + 0296eaf commit 5a4c026
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions http/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ func (s *Service) periodicClearStaticValues(ctx context.Context) {
go func(s *Service, ctx context.Context) {
// Refreah every 5 minutes.
refreshTicker := time.NewTicker(5 * time.Minute)
defer refreshTicker.Stop()
for {
select {
case <-refreshTicker.C:
Expand Down

0 comments on commit 5a4c026

Please sign in to comment.