mirror of https://github.com/tidwall/tile38.git
keepalive default of 300 seconds
This commit is contained in:
parent
77632d8cc3
commit
730502d99d
|
@ -14,6 +14,10 @@ import (
|
||||||
"github.com/tidwall/tile38/controller/server"
|
"github.com/tidwall/tile38/controller/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
defaultKeepAlive = 300 // seconds
|
||||||
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
RequirePass = "requirepass"
|
RequirePass = "requirepass"
|
||||||
LeaderAuth = "leaderauth"
|
LeaderAuth = "leaderauth"
|
||||||
|
@ -169,7 +173,7 @@ func (c *Controller) setConfigProperty(name, value string, fromLoad bool) error
|
||||||
}
|
}
|
||||||
case KeepAlive:
|
case KeepAlive:
|
||||||
if value == "" {
|
if value == "" {
|
||||||
c.config.KeepAlive = 300
|
c.config.KeepAlive = defaultKeepAlive
|
||||||
} else {
|
} else {
|
||||||
keepalive, err := strconv.ParseUint(value, 10, 64)
|
keepalive, err := strconv.ParseUint(value, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -217,6 +221,7 @@ func (c *Controller) getConfigProperty(name string) string {
|
||||||
|
|
||||||
func (c *Controller) initConfig() error {
|
func (c *Controller) initConfig() error {
|
||||||
c.config = Config{ServerID: randomKey(16)}
|
c.config = Config{ServerID: randomKey(16)}
|
||||||
|
c.config.KeepAlive = defaultKeepAlive
|
||||||
return c.writeConfig(true)
|
return c.writeConfig(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue