mirror of
https://github.com/digitalocean/ceph_exporter
synced 2025-03-02 10:10:24 +00:00
Add constant for tcp keepalive periode
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
This commit is contained in:
parent
cd9aa031a8
commit
a42a258a28
@ -35,6 +35,8 @@ import (
|
||||
// specifically check if it hits EMFILE when doing an accept, and if so,
|
||||
// terminate the process.
|
||||
|
||||
const keepAlive time.Duration = 3 * time.Minute
|
||||
|
||||
type emfileAwareTcpListener struct {
|
||||
*net.TCPListener
|
||||
}
|
||||
@ -52,7 +54,7 @@ func (ln emfileAwareTcpListener) Accept() (c net.Conn, err error) {
|
||||
return
|
||||
}
|
||||
tc.SetKeepAlive(true)
|
||||
tc.SetKeepAlivePeriod(3 * time.Minute)
|
||||
tc.SetKeepAlivePeriod(keepAlive)
|
||||
return tc, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user