From 1b507c1080b5a02aa86cc298cdca4590886f57eb Mon Sep 17 00:00:00 2001 From: hopeyen Date: Tue, 29 Oct 2024 11:53:51 -0700 Subject: [PATCH] refactor: use configsnot params --- core/meterer/meterer.go | 4 ++-- core/meterer/meterer_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/meterer/meterer.go b/core/meterer/meterer.go index 4f24ec6e12..53ac0848af 100644 --- a/core/meterer/meterer.go +++ b/core/meterer/meterer.go @@ -50,9 +50,9 @@ func NewMeterer( } // Start starts to periodically refreshing the on-chain state -func (m *Meterer) Start(ctx context.Context, updateInterval time.Duration) { +func (m *Meterer) Start(ctx context.Context) { go func() { - ticker := time.NewTicker(updateInterval) + ticker := time.NewTicker(m.UpdateInterval) defer ticker.Stop() for { diff --git a/core/meterer/meterer_test.go b/core/meterer/meterer_test.go index ef6e9f8cf3..8fb2d1b9df 100644 --- a/core/meterer/meterer_test.go +++ b/core/meterer/meterer_test.go @@ -158,7 +158,7 @@ func setup(_ *testing.M) { // metrics.NewNoopMetrics(), ) - mt.Start(context.Background(), config.UpdateInterval) + mt.Start(context.Background()) } func teardown() {