Define BootstrapExepct as an int32 so it can be manipulated atomically.

This commit is contained in:
Sean Chittenden
2016-06-16 12:00:15 -07:00
parent a915cdc337
commit 4d149888cc
4 changed files with 20 additions and 12 deletions

View File

@@ -11,6 +11,7 @@ import (
"strconv"
"strings"
"sync"
"sync/atomic"
"time"
"github.com/hashicorp/nomad/client"
@@ -110,7 +111,7 @@ func (a *Agent) serverConfig() (*nomad.Config, error) {
if a.config.Server.BootstrapExpect == 1 {
conf.Bootstrap = true
} else {
conf.BootstrapExpect = a.config.Server.BootstrapExpect
atomic.StoreInt32(&conf.BootstrapExpect, int32(a.config.Server.BootstrapExpect))
}
}
if a.config.DataDir != "" {