Skip to content

Commit

Permalink
Fix: monitor ticker
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Apr 6, 2022
1 parent 4ebcffb commit ef08e60
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion node/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,14 @@ func (monitor *Monitor) pollingMempool(ctx context.Context, filter string) {

url := fmt.Sprintf("/chains/main/mempool/monitor_operations?%s", filter)

ticker := time.NewTicker(time.Second)
defer ticker.Stop()

for {
select {
case <-ctx.Done():
return
default:
case <-ticker.C:
if err := monitor.process(ctx, filter, url); err != nil {
log.Err(err).Msg("")
continue
Expand Down

0 comments on commit ef08e60

Please sign in to comment.