mirror of https://github.com/docker/docs.git
Remove unused code
Signed-off-by: Alexandre Beslic <abronan@docker.com>
This commit is contained in:
parent
5d106186fb
commit
4537b9f2ba
|
|
@ -45,7 +45,6 @@ Options:
|
|||
{{range .Flags}}{{.}}
|
||||
{{end}}{{if (eq .Name "manage")}}{{printf "\t * swarm.overcommit=0.05\tovercommit to apply on resources"}}
|
||||
{{printf "\t * swarm.discovery.heartbeat=25s\tperiod between each heartbeat"}}{{end}}{{ end }}
|
||||
{{printf "\t * swarm.discovery.ttl=75s\ttime limit for a key to expire if ephemeral"}}{{end}}{{ end }}
|
||||
`
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ func NewCluster(scheduler *scheduler.Scheduler, store *state.Store, TLSConfig *t
|
|||
}
|
||||
|
||||
heartbeat := 25 * time.Second
|
||||
ttl := 75 * time.Second
|
||||
if opt, ok := options.String("swarm.discovery.heartbeat", ""); ok {
|
||||
h, err := time.ParseDuration(opt)
|
||||
if err != nil {
|
||||
|
|
@ -68,19 +67,8 @@ func NewCluster(scheduler *scheduler.Scheduler, store *state.Store, TLSConfig *t
|
|||
heartbeat = h
|
||||
}
|
||||
|
||||
if opt, ok := options.String("swarm.discovery.ttl", ""); ok {
|
||||
t, err := time.ParseDuration(opt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if t <= heartbeat {
|
||||
return nil, fmt.Errorf("invalid ttl %s: must be strictly superior to heartbeat value", opt)
|
||||
}
|
||||
ttl = t
|
||||
}
|
||||
|
||||
// Set up discovery.
|
||||
cluster.discovery, err = discovery.New(dflag, heartbeat, ttl)
|
||||
cluster.discovery, err = discovery.New(dflag, heartbeat, 0)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,13 +93,6 @@ type Store interface {
|
|||
AtomicDelete(key string, previous *KVPair) (bool, error)
|
||||
}
|
||||
|
||||
const (
|
||||
// DefaultTTL is the default time used for a node
|
||||
// to be removed, it is set to 0 to explain
|
||||
// that there is no expiration
|
||||
DefaultTTL = 0
|
||||
)
|
||||
|
||||
// KVPair represents {Key, Value, Lastindex} tuple
|
||||
type KVPair struct {
|
||||
Key string
|
||||
|
|
|
|||
Loading…
Reference in New Issue