Skip to content

Commit

Permalink
Adapt the heartbeat checker to
Browse files Browse the repository at this point in the history
the configuration. In case a heartbeat less than 20 seconds the client could raise
missing heart beat. In some case could disconnect the client

Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
  • Loading branch information
Gsantomaggio committed Nov 22, 2024
1 parent 82c7891 commit 6a67d2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/stream/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ func (c *Client) heartBeat() {

go func() {
for c.socket.isOpen() {
<-tickerHeatBeat.C
<-tickerHeartbeat.C
if time.Since(c.getLastHeartBeat()) > time.Duration(c.tuneState.requestedHeartbeat)*time.Second {
v := atomic.AddInt32(&heartBeatMissed, 1)
logs.LogWarn("Missing heart beat: %d", v)
Expand All @@ -434,7 +434,7 @@ func (c *Client) heartBeat() {
}

}
tickerHeatBeat.Stop()
tickerHeartbeat.Stop()
}()

go func() {
Expand Down

0 comments on commit 6a67d2b

Please sign in to comment.