From: Jeff Halter Date: Wed, 19 Apr 2023 23:55:00 +0000 (-0700) Subject: Make keepalive interval a const X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/commitdiff_plain/f85c2d086919ca24cea8608538594a2f8cc25fd8 Make keepalive interval a const --- diff --git a/hotline/client.go b/hotline/client.go index a3ee425..12e3167 100644 --- a/hotline/client.go +++ b/hotline/client.go @@ -543,9 +543,11 @@ func (c *Client) Connect(address, login, passwd string) (err error) { return nil } +const keepaliveInterval = 300 * time.Second + func (c *Client) keepalive() error { for { - time.Sleep(300 * time.Second) + time.Sleep(keepaliveInterval) _ = c.Send(*NewTransaction(TranKeepAlive, nil)) c.Logger.Infow("Sent keepalive ping") }