Merge pull request #11980 from cfc4n/simple-token-ttl

auth: Customize the settings of simpleTokenTTL.
This commit is contained in:
Gyuho Lee
2020-06-21 23:23:45 -07:00
committed by GitHub
10 changed files with 45 additions and 25 deletions

View File

@@ -126,6 +126,7 @@ type ServerConfig struct {
AuthToken string
BcryptCost uint
TokenTTL uint
// InitialCorruptCheck is true to check data corruption on boot
// before serving any peer/client traffic.

View File

@@ -531,6 +531,7 @@ func NewServer(cfg ServerConfig) (srv *EtcdServer, err error) {
func(index uint64) <-chan struct{} {
return srv.applyWait.Wait(index)
},
time.Duration(cfg.TokenTTL)*time.Second,
)
if err != nil {
cfg.Logger.Warn("failed to create token provider", zap.Error(err))