Skip to content

Commit

Permalink
Revert "tickers: use Reset over Stop/NewTicker (#985)"
Browse files Browse the repository at this point in the history
This reverts commit 5b0c8b3.
  • Loading branch information
iskakaushik committed Jan 25, 2024
1 parent 1c71d71 commit ca68b64
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion flow/activities/flowable.go
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,8 @@ func (a *FlowableActivity) SendWALHeartbeat(ctx context.Context) error {
slog.InfoContext(ctx, fmt.Sprintf("sent walheartbeat to peer %v", pgPeer.Name))
}
}
ticker.Reset(sendTimeout)
ticker.Stop()
ticker = time.NewTicker(sendTimeout)
}
}

Expand Down
3 changes: 2 additions & 1 deletion flow/activities/slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func (a *FlowableActivity) recordSlotSizePeriodically(
case <-ctx.Done():
return
}
ticker.Reset(timeout)
ticker.Stop()
ticker = time.NewTicker(timeout)
}
}
3 changes: 2 additions & 1 deletion flow/connectors/eventhub/eventhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ func (c *EventHubConnector) processBatch(
}
}

ticker.Reset(eventHubFlushTimeout)
ticker.Stop()
ticker = time.NewTicker(eventHubFlushTimeout)
}
}
}
Expand Down

0 comments on commit ca68b64

Please sign in to comment.