From ca9f0a08e1127e676623020fddd3a5c6ecbe6263 Mon Sep 17 00:00:00 2001 From: Joanne Tweed Date: Mon, 14 Oct 2024 16:20:49 +0800 Subject: [PATCH] fix: reset `ReadTimeout`&`ReadTimeout` for sentinel mode through ssh --- backend/services/connection_service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/services/connection_service.go b/backend/services/connection_service.go index 2d628dc..ca08daf 100644 --- a/backend/services/connection_service.go +++ b/backend/services/connection_service.go @@ -226,6 +226,10 @@ func (c *connectionService) createRedisClient(config types.ConnectionConfig) (re option.Addr = net.JoinHostPort(addr[0], addr[1]) option.Username = config.Sentinel.Username option.Password = config.Sentinel.Password + if option.Dialer != nil { + option.ReadTimeout = -2 + option.WriteTimeout = -2 + } } if config.LastDB > 0 {