Skip to content

Commit

Permalink
embed: don't compare uint to any negative number (etcd-io#11603)
Browse files Browse the repository at this point in the history
  • Loading branch information
spzala authored Feb 10, 2020
1 parent 4c25efc commit e5c90eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions embed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,10 @@ func (cfg *Config) Validate() error {
return ErrConflictBootstrapFlags
}

if cfg.TickMs <= 0 {
if cfg.TickMs == 0 {
return fmt.Errorf("--heartbeat-interval must be >0 (set to %dms)", cfg.TickMs)
}
if cfg.ElectionMs <= 0 {
if cfg.ElectionMs == 0 {
return fmt.Errorf("--election-timeout must be >0 (set to %dms)", cfg.ElectionMs)
}
if 5*cfg.TickMs > cfg.ElectionMs {
Expand Down

0 comments on commit e5c90eb

Please sign in to comment.