Skip to content

Commit

Permalink
close metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan committed Oct 31, 2023
1 parent c5aec2d commit 7d65a7b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 40 deletions.
39 changes: 0 additions & 39 deletions metrics.go

This file was deleted.

4 changes: 4 additions & 0 deletions store/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,9 @@ func (m *metrics) observe(ctx context.Context, f func(context.Context)) {
}

func (m *metrics) Close() error {
if m == nil {
return nil
}

return m.headHeightReg.Unregister()
}
2 changes: 1 addition & 1 deletion store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (s *Store[H]) Stop(ctx context.Context) error {
// cleanup caches
s.cache.Purge()
s.heightIndex.cache.Purge()
return nil
return s.metrics.Close()
}

func (s *Store[H]) Height() uint64 {
Expand Down

0 comments on commit 7d65a7b

Please sign in to comment.