Skip to content

Commit

Permalink
redis cluster add timeout ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
sayn authored and sayn committed Aug 9, 2024
1 parent 736ed56 commit 8944443
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sql/engines/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
import shlex

import redis
import rediscluster
import logging
import traceback

from common.utils.timer import FuncTimer
from . import EngineBase
from .models import ResultSet, ReviewSet, ReviewResult
from rediscluster import RedisCluster

__author__ = "hhyo"

Expand All @@ -28,9 +28,11 @@ class RedisEngine(EngineBase):
def get_connection(self, db_name=None):
db_name = db_name or self.db_name
if self.mode == "cluster":
return RedisCluster(
return rediscluster.RedisCluster(
startup_nodes=[{"host": self.host, "port": self.port}],
decode_responses=True,
socket_connect_timeout=10,
ssl=self.is_ssl,
password=self.password,
)
else:
Expand Down

0 comments on commit 8944443

Please sign in to comment.