Log when command-line peer list overridden by persisted list
Reworked interface to router so we split setting up the initial list from beginning to make connections - we shouldn't do that until after router.Start().
This commit is contained in:
1 parent
ba8926a6ea
commit
b064bcce49
4 files changed
+46
-21
No files matched your search
+5
-2
@@ -127,7 +127,6 @@ func main() {
|
||||
}
|
||||
|
||||
Log.Println("Command line options:", options())
|
||||
Log.Println("Command line peers:", peers)
|
||||
|
||||
if prof != "" {
|
||||
p := *profile.CPUProfile
|
||||
@@ -169,6 +168,10 @@ func main() {
|
||||
router := weave.NewNetworkRouter(config, networkConfig, name, nickName, overlay, db)
|
||||
Log.Println("Our name is", router.Ourself)
|
||||
|
||||
if peers, err = router.InitialPeers(peers); err != nil {
|
||||
Log.Fatal("Unable to get initial peer set: ", err)
|
||||
}
|
||||
|
||||
var dockerCli *docker.Client
|
||||
if dockerAPI != "" {
|
||||
dc, err := docker.NewClient(dockerAPI)
|
||||
@@ -215,7 +218,7 @@ func main() {
|
||||
}
|
||||
|
||||
router.Start()
|
||||
if errors := router.SetInitialPeers(peers); len(errors) > 0 {
|
||||
if errors := router.InitiateConnections(peers, false); len(errors) > 0 {
|
||||
Log.Fatal(ErrorMessages(errors))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user