diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2023-04-19 16:55:00 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2023-04-19 16:55:00 -0700 |
| commit | f85c2d086919ca24cea8608538594a2f8cc25fd8 (patch) | |
| tree | 8bb3b5ac3fd3b035f07acd90806995bd37c66d54 /hotline/client.go | |
| parent | 9b93c0934afe5422326a33a3edab9c3ebeb58c7f (diff) | |
Make keepalive interval a const
Diffstat (limited to 'hotline/client.go')
| -rw-r--r-- | hotline/client.go | 4 |
1 files changed, 3 insertions, 1 deletions
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") } |