From 90d8f6e0df40fd206d6961fc04fef2f68ac879ee Mon Sep 17 00:00:00 2001 From: yedf2 <120050102@qq.com> Date: Fri, 3 Dec 2021 16:27:50 +0800 Subject: [PATCH] rename URL to Target --- common/types.go | 4 ++-- conf.sample.yml | 6 +++++- dtmsvr/dtmsvr.go | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/common/types.go b/common/types.go index c68f8ba..414d246 100644 --- a/common/types.go +++ b/common/types.go @@ -26,7 +26,7 @@ const ( // MicroService config type for micro service type MicroService struct { Driver string `yaml:"Driver"` - URL string `yaml:"URL"` + Target string `yaml:"Target"` EndPoint string `yaml:"EndPoint"` } @@ -62,7 +62,7 @@ func MustLoadConfig() { "conn_max_life_time": dtmimp.OrString(os.Getenv("DB_CONN_MAX_LIFE_TIME"), "5"), } DtmConfig.MicroService.Driver = dtmimp.OrString(os.Getenv("MICRO_SERVICE_DRIVER"), "default") - DtmConfig.MicroService.URL = os.Getenv("MICRO_SERVICE_URL") + DtmConfig.MicroService.Target = os.Getenv("MICRO_SERVICE_TARGET") DtmConfig.MicroService.EndPoint = os.Getenv("MICRO_SERVICE_ENDPOINT") DtmConfig.DisableLocalhost = getIntEnv("DISABLE_LOCALHOST", "0") DtmConfig.UpdateBranchSync = getIntEnv("UPDATE_BRANCH_SYNC", "0") diff --git a/conf.sample.yml b/conf.sample.yml index f306ef2..4701009 100644 --- a/conf.sample.yml +++ b/conf.sample.yml @@ -16,8 +16,12 @@ DB: # conn_max_life_time: 'dbconnmaxlifetime' # MicroService: # Driver: 'dtm-driver-gozero' # name of the driver to handle register/discover -# URL: 'etcd://localhost:2379/dtmservice' # register dtm server to this url +# Target: 'etcd://localhost:2379/dtmservice' # register dtm server to this url # EndPoint: 'localhost:36790' + +# MicroService: +# Driver: 'dtm-driver-protocol1' + # the unit of following configurations is second # TransCronInterval: 3 # the interval to poll unfinished global transaction for every dtm process diff --git a/dtmsvr/dtmsvr.go b/dtmsvr/dtmsvr.go index f744dce..750c2f9 100644 --- a/dtmsvr/dtmsvr.go +++ b/dtmsvr/dtmsvr.go @@ -54,7 +54,7 @@ func StartSvr() { time.Sleep(100 * time.Millisecond) err = dtmdriver.Use(config.MicroService.Driver) dtmimp.FatalIfError(err) - err = dtmdriver.GetDriver().RegisterGrpcService(config.MicroService.URL, config.MicroService.EndPoint) + err = dtmdriver.GetDriver().RegisterGrpcService(config.MicroService.Target, config.MicroService.EndPoint) dtmimp.FatalIfError(err) }