diff --git a/common/config.go b/common/config.go index 7744323..5be36d3 100644 --- a/common/config.go +++ b/common/config.go @@ -30,8 +30,8 @@ type Store struct { MaxOpenConns int64 `yaml:"MaxOpenConns" default:"500"` MaxIdleConns int64 `yaml:"MaxIdleConns" default:"500"` ConnMaxLifeTime int64 `yaml:"ConnMaxLifeTime" default:"5"` - RedisExpire int64 `yaml:"RedisExpire" default:"604800"` // Trans data will expire in 7 days - RedisPrefix string `yaml:"RedisPrefix" default:"{}"` // Redis storage prefix. stored to only one slot in cluster + DataExpire int64 `yaml:"DataExpire" default:"604800"` // Trans data will expire in 7 days. only for redis/boltdb. + RedisPrefix string `yaml:"RedisPrefix" default:"{}"` // Redis storage prefix. store data to only one slot in cluster } func (s *Store) IsDB() bool { diff --git a/conf.sample.yml b/conf.sample.yml index 6c5919f..3d698c0 100644 --- a/conf.sample.yml +++ b/conf.sample.yml @@ -24,6 +24,10 @@ Store: # specify which engine to store trans status # MaxIdleConns: 500 # ConnMaxLifeTime 5 # default value is 5 (minutes) +### flollowing config is only for some Driver +# DataExpire: 604800 # Trans data will expire in 7 days. only for redis/boltdb. +# RedisPrefix: '{}' # default value is '{}'. Redis storage prefix. store data to only one slot in cluster + # MicroService: # Driver: 'dtm-driver-gozero' # name of the driver to handle register/discover # Target: 'etcd://localhost:2379/dtmservice' # register dtm server to this url diff --git a/dtmsvr/storage/redis.go b/dtmsvr/storage/redis.go index 1b225d1..5bc751e 100644 --- a/dtmsvr/storage/redis.go +++ b/dtmsvr/storage/redis.go @@ -82,7 +82,7 @@ type argList struct { func newArgList() *argList { a := &argList{} - return a.AppendRaw(config.Store.RedisPrefix).AppendObject(config.Store.RedisExpire) + return a.AppendRaw(config.Store.RedisPrefix).AppendObject(config.Store.DataExpire) } func (a *argList) AppendRaw(v interface{}) *argList {