diff --git a/flow/activities/flowable.go b/flow/activities/flowable.go index a2e57f6d0f..6ee858c028 100644 --- a/flow/activities/flowable.go +++ b/flow/activities/flowable.go @@ -819,8 +819,7 @@ func (a *FlowableActivity) SendWALHeartbeat(ctx context.Context) error { slog.InfoContext(ctx, fmt.Sprintf("sent walheartbeat to peer %v", pgPeer.Name)) } } - ticker.Stop() - ticker = time.NewTicker(sendTimeout) + ticker.Reset(sendTimeout) } } diff --git a/flow/activities/slot.go b/flow/activities/slot.go index baa0fbc0fa..ef0114102a 100644 --- a/flow/activities/slot.go +++ b/flow/activities/slot.go @@ -88,7 +88,6 @@ func (a *FlowableActivity) recordSlotSizePeriodically( case <-ctx.Done(): return } - ticker.Stop() - ticker = time.NewTicker(timeout) + ticker.Reset(timeout) } } diff --git a/flow/connectors/eventhub/eventhub.go b/flow/connectors/eventhub/eventhub.go index c8ba3dad41..1bb7b00166 100644 --- a/flow/connectors/eventhub/eventhub.go +++ b/flow/connectors/eventhub/eventhub.go @@ -195,8 +195,7 @@ func (c *EventHubConnector) processBatch( } } - ticker.Stop() - ticker = time.NewTicker(eventHubFlushTimeout) + ticker.Reset(eventHubFlushTimeout) } } }