diff --git a/server/opts.go b/server/opts.go index 950c4bfd..6ece7476 100644 --- a/server/opts.go +++ b/server/opts.go @@ -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": diff --git a/server/opts_test.go b/server/opts_test.go index 082f30f0..39dcf6eb 100644 --- a/server/opts_test.go +++ b/server/opts_test.go @@ -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, }