Skip to content

Commit

Permalink
stop refreshTicker on context cancel in http/service.go
Browse files Browse the repository at this point in the history
  • Loading branch information
draganm committed Aug 14, 2023
1 parent 912094d commit 0296eaf
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 0296eaf

Please sign in to comment.