Browse Source

rename config RedisExpire to DataExpire

pull/90/head
yedf2 4 years ago
parent
commit
db658c90c0
  1. 4
      common/config.go
  2. 4
      conf.sample.yml
  3. 2
      dtmsvr/storage/redis.go

4
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 {

4
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

2
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 {

Loading…
Cancel
Save