From a0c23fcec45d18efe14ba03128a976e1fc1b0f21 Mon Sep 17 00:00:00 2001
From: chenshijun <csj_sky@126.com>
Date: 星期六, 12 十月 2019 10:15:37 +0800
Subject: [PATCH] Merge branch 'master' of ssh://192.168.1.14:29418/syncdb

---
 config.go |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/config.go b/config.go
index 329d114..79b07a5 100644
--- a/config.go
+++ b/config.go
@@ -20,7 +20,6 @@
 	"fmt"
 	"net"
 	"strconv"
-
 	//"github.com/apache/servicecomb-service-center/syncer/pkg/utils"
 	"github.com/hashicorp/memberlist"
 	"github.com/hashicorp/serf/cmd/serf/command/agent"
@@ -44,7 +43,12 @@
 	BroadcastInterval  = 5
 	MaxQueryRespSize   = 50 * 1024 * 1024
 	MaxQuerySize       = 50 * 1024 * 1024
-	MaxUserEventSize   = 5 * 1024
+	MaxUserEventSize   = 9 * 1024
+	ReplayOnJoinDefault = false
+	SnapshotPathDefault = "./serfSnapShot"
+	MaxEventBufferCount = 2048
+
+	TcpTransportPort = 30194 //tcp浼犺緭澶ф暟鎹噺鎺ュ彛
 )
 
 // DefaultConfig default config
@@ -85,7 +89,7 @@
 }
 
 // convertToSerf convert Config to serf.Config
-func (c *Config) convertToSerf() (*serf.Config, error) {
+func (c *Config) convertToSerf(snapshotPath string) (*serf.Config, error) {
 	serfConf := serf.DefaultConfig()
 
 	bindIP, bindPort, err := SplitHostPort(c.BindAddr, DefaultBindPort)
@@ -118,6 +122,20 @@
 	if c.Mode == ModeCluster && c.RetryMaxAttempts <= 0 {
 		c.RetryMaxAttempts = retryMaxAttempts
 	}
+
+	c.SnapshotPath = SnapshotPathDefault
+	if snapshotPath != "" {
+		c.SnapshotPath = snapshotPath
+	}
+
+	c.ReplayOnJoin = ReplayOnJoinDefault
+
+	serfConf.QueryResponseSizeLimit = c.QueryResponseSizeLimit
+	serfConf.QuerySizeLimit = c.QuerySizeLimit
+	serfConf.UserEventSizeLimit = c.UserEventSizeLimit
+	serfConf.SnapshotPath = c.SnapshotPath
+	serfConf.EventBuffer = MaxEventBufferCount
+
 	return serfConf, nil
 }
 

--
Gitblit v1.8.0