From c94c949173b87034b5d4375f60bac409417d35a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Fri, 28 Jun 2024 11:12:53 +0200 Subject: [PATCH] Add comment --- relay/healthcheck/receiver.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/relay/healthcheck/receiver.go b/relay/healthcheck/receiver.go index 157fb6684..147fe2d5f 100644 --- a/relay/healthcheck/receiver.go +++ b/relay/healthcheck/receiver.go @@ -23,6 +23,7 @@ type Receiver struct { live bool } +// NewReceiver creates a new healthcheck receiver and start the timer in the background func NewReceiver() *Receiver { ctx, ctxCancel := context.WithCancel(context.Background()) @@ -37,6 +38,7 @@ func NewReceiver() *Receiver { return r } +// Heartbeat acknowledge the heartbeat has been received func (r *Receiver) Heartbeat() { select { case r.heartbeat <- struct{}{}: @@ -44,6 +46,7 @@ func (r *Receiver) Heartbeat() { } } +// Stop check the timeout and do not send new notifications func (r *Receiver) Stop() { r.ctxCancel() }