From 4d6bafff86a6863450622c96f00661b9eb686b90 Mon Sep 17 00:00:00 2001
From: chenshijun <csj_sky@126.com>
Date: 星期三, 15 一月 2020 15:42:49 +0800
Subject: [PATCH] 修改snapShot的bug
---
agent.go | 8 ++++----
agent_test.go | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/agent.go b/agent.go
index b94b7a7..8c2d295 100644
--- a/agent.go
+++ b/agent.go
@@ -520,8 +520,8 @@
}
//Init serf Init
-func Init(clusterID string, password string, nodeID string, addrs []string) (*Agent, error) {
- agent, err := InitNode(clusterID, password, nodeID)
+func Init(clusterID string, password string, nodeID string, addrs []string, snapshotPath string) (*Agent, error) {
+ agent, err := InitNode(clusterID, password, nodeID, snapshotPath)
if err != nil {
//fmt.Printf("InitNode failed, error: %s", err)
return agent, err
@@ -537,7 +537,7 @@
}
//InitNode web鍚庡彴鏀跺埌鍒涘缓闆嗙兢鐨勮姹傦紝
-func InitNode(clusterID string, password string, nodeID string) (*Agent, error) {
+func InitNode(clusterID string, password string, nodeID string, snapshotPath string) (*Agent, error) {
conf := DefaultConfig()
//fmt.Println("clusterID:", clusterID, "password:", password, "nodeID:", nodeID)
conf.ClusterID = clusterID
@@ -553,7 +553,7 @@
}
conf.EncryptKey = password
}
- agent, err := Create(conf)
+ agent, err := Create(conf, snapshotPath)
if err != nil {
//fmt.Printf("create agent failed, error: %s", err)
return agent, err
diff --git a/agent_test.go b/agent_test.go
index fbabde6..61a8d23 100644
--- a/agent_test.go
+++ b/agent_test.go
@@ -28,7 +28,7 @@
conf := DefaultConfig()
conf.ClusterID = "testCluster"
conf.NodeName = "testnode"
- agent, err := Create(conf)
+ agent, err := Create(conf, "")
if err != nil {
t.Errorf("create agent failed, error: %s", err)
}
--
Gitblit v1.8.0