Skip to content

Commit

Permalink
fix: start meterer
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Jan 8, 2025
1 parent 731e01d commit 2dcd77e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/meterer/meterer.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewMeterer(
// Start starts to periodically refreshing the on-chain state
func (m *Meterer) Start(ctx context.Context) {
go func() {
ticker := time.NewTicker(m.UpdateInterval)
ticker := time.NewTicker(m.Config.UpdateInterval)
defer ticker.Stop()

for {
Expand All @@ -63,6 +63,7 @@ func (m *Meterer) Start(ctx context.Context) {
if err := m.ChainPaymentState.RefreshOnchainPaymentState(ctx); err != nil {
m.logger.Error("Failed to refresh on-chain state", "error", err)
}
m.logger.Info("Refreshed on-chain state")
case <-ctx.Done():
return
}
Expand Down
1 change: 1 addition & 0 deletions disperser/cmd/apiserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func RunDisperserServer(ctx *cli.Context) error {
logger,
// metrics.NewNoopMetrics(),
)
meterer.Start(context.Background())
}

var ratelimiter common.RateLimiter
Expand Down

0 comments on commit 2dcd77e

Please sign in to comment.