[#370] Treat ping interval from config as seconds (there is no point in smaller granularity).

This commit is contained in:
Volodymyr Khoroz
2016-11-15 16:43:56 +02:00
parent a98b51a5ca
commit a35d98eebe
2 changed files with 3 additions and 3 deletions

View File

@@ -217,7 +217,7 @@ func ProcessConfigFile(configFile string) (*Options, error) {
case "max_connections", "max_conn":
opts.MaxConn = int(v.(int64))
case "ping_interval":
opts.PingInterval = time.Duration(int(v.(int64)))
opts.PingInterval = time.Duration(int(v.(int64))) * time.Second
case "ping_max":
opts.MaxPingsOut = int(v.(int64))
case "tls":

View File

@@ -67,7 +67,7 @@ func TestConfigFile(t *testing.T) {
MaxPayload: 65536,
MaxConn: 100,
MaxPending: 10000000,
PingInterval: 60,
PingInterval: 60 * time.Second,
MaxPingsOut: 3,
}
@@ -189,7 +189,7 @@ func TestMergeOverrides(t *testing.T) {
MaxPayload: 65536,
MaxConn: 100,
MaxPending: 10000000,
PingInterval: 60,
PingInterval: 60 * time.Second,
MaxPingsOut: 3,
ClusterNoAdvertise: true,
}