Skip to content

Commit

Permalink
style(common): rename Ttl to TTL
Browse files Browse the repository at this point in the history
  • Loading branch information
justxuewei committed Nov 6, 2021
1 parent 0d185fc commit d6352c1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/constant/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (
DefaultRetriesInt = 2
DefaultProtocol = "dubbo"
DefaultRegTimeout = "10s"
DefaultRegTtl = "15m"
DefaultRegTTL = "15m"
DefaultCluster = "failover"
DefaultFailbackTimes = "3"
DefaultFailbackTimesInt = 3
Expand Down
2 changes: 1 addition & 1 deletion registry/zookeeper/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (r *zkRegistry) registerTempZookeeperNode(root string, node string) error {
func (r *zkRegistry) getListener(conf *common.URL) (*RegistryConfigurationListener, error) {
var zkListener *RegistryConfigurationListener
dataListener := r.dataListener
ttl := r.GetParam(constant.RegistryTTLKey, constant.DefaultRegTtl)
ttl := r.GetParam(constant.RegistryTTLKey, constant.DefaultRegTTL)
conf.SetParam(constant.RegistryTTLKey, ttl)
dataListener.mutex.Lock()
defer dataListener.mutex.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion remoting/zookeeper/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (l *ZkEventListener) listenDirEvent(conf *common.URL, zkRootPath string, li
event = make(chan struct{}, 4)
ttl = defaultTTL
if conf != nil {
timeout, err := time.ParseDuration(conf.GetParam(constant.RegistryTTLKey, constant.DefaultRegTtl))
timeout, err := time.ParseDuration(conf.GetParam(constant.RegistryTTLKey, constant.DefaultRegTTL))
if err == nil {
ttl = timeout
} else {
Expand Down

0 comments on commit d6352c1

Please sign in to comment.