@@ -34,7 +34,7 @@ func (s *Topom) AddSentinel(addr string) error {
3434 }
3535
3636 sentinel := redis .NewSentinel (s .config .ProductName , s .config .ProductAuth )
37- if err := sentinel .FlushConfig (addr , time . Second * 5 ); err != nil {
37+ if err := sentinel .FlushConfig (addr , s . config . SentinelClientTimeout . Duration () ); err != nil {
3838 return err
3939 }
4040 defer s .dirtySentinelCache ()
@@ -74,7 +74,7 @@ func (s *Topom) DelSentinel(addr string, force bool) error {
7474 }
7575
7676 sentinel := redis .NewSentinel (s .config .ProductName , s .config .ProductAuth )
77- if err := sentinel .RemoveGroupsAll ([]string {addr }, time . Second * 5 ); err != nil {
77+ if err := sentinel .RemoveGroupsAll ([]string {addr }, s . config . SentinelClientTimeout . Duration () ); err != nil {
7878 log .WarnErrorf (err , "remove sentinel %s failed" , addr )
7979 if ! force {
8080 return errors .Errorf ("remove sentinel %s failed" , addr )
@@ -194,10 +194,10 @@ func (s *Topom) ResyncSentinels() error {
194194 }
195195
196196 sentinel := redis .NewSentinel (s .config .ProductName , s .config .ProductAuth )
197- if err := sentinel .RemoveGroupsAll (p .Servers , time . Second * 5 ); err != nil {
197+ if err := sentinel .RemoveGroupsAll (p .Servers , s . config . SentinelClientTimeout . Duration () ); err != nil {
198198 log .WarnErrorf (err , "remove sentinels failed" )
199199 }
200- if err := sentinel .MonitorGroups (p .Servers , time . Second * 5 , config , ctx .getGroupMasters ()); err != nil {
200+ if err := sentinel .MonitorGroups (p .Servers , s . config . SentinelClientTimeout . Duration () , config , ctx .getGroupMasters ()); err != nil {
201201 log .WarnErrorf (err , "resync sentinels failed" )
202202 return err
203203 }
0 commit comments