Skip to content

Commit 823253e

Browse files
committed
pref: add keep connection alive option
1 parent 1439a65 commit 823253e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/services/connection_service.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ func (c *connectionService) buildOption(config types.ConnectionConfig) (*redis.O
149149
DialTimeout: time.Duration(config.ConnTimeout) * time.Second,
150150
ReadTimeout: time.Duration(config.ExecTimeout) * time.Second,
151151
WriteTimeout: time.Duration(config.ExecTimeout) * time.Second,
152+
ConnMaxIdleTime: 0,
152153
TLSConfig: tlsConfig,
153154
DisableIdentity: true,
154155
IdentitySuffix: "tinyrdm_",
@@ -239,7 +240,7 @@ func (c *connectionService) createRedisClient(config types.ConnectionConfig) (re
239240
rdb := redis.NewClient(option)
240241
if config.Cluster.Enable {
241242
defer rdb.Close()
242-
243+
243244
// connect to cluster
244245
var slots []redis.ClusterSlot
245246
if slots, err = rdb.ClusterSlots(c.ctx).Result(); err == nil {

0 commit comments

Comments
 (0)