Skip to content

Commit ef08e60

Browse files
Fix: monitor ticker
1 parent 4ebcffb commit ef08e60

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

node/monitor.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,14 @@ func (monitor *Monitor) pollingMempool(ctx context.Context, filter string) {
141141

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

144+
ticker := time.NewTicker(time.Second)
145+
defer ticker.Stop()
146+
144147
for {
145148
select {
146149
case <-ctx.Done():
147150
return
148-
default:
151+
case <-ticker.C:
149152
if err := monitor.process(ctx, filter, url); err != nil {
150153
log.Err(err).Msg("")
151154
continue

0 commit comments

Comments
 (0)