mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 11:48:43 -07:00
[#370] Treat ping interval from config as seconds (there is no point in smaller granularity).
This commit is contained in:
@@ -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":
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user