Skip to content

Commit 4c32f1d

Browse files
committed
added valkey sentinel support
1 parent 2ad5da9 commit 4c32f1d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scheduler/connection_types.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
from typing import Union, Dict, Tuple, Type
22

33
import redis
4-
import valkey
4+
try:
5+
import valkey
6+
except ImportError:
7+
valkey = redis
58

69
from scheduler.settings import Broker
710

811
ConnectionErrorType = Union[redis.ConnectionError, valkey.ConnectionError]
912
ConnectionType = Union[redis.Redis, valkey.Valkey]
1013
PipelineType = Union[redis.client.Pipeline, valkey.client.Pipeline]
1114
RedisSentinel = redis.sentinel.Sentinel
15+
ValkeySentinel = valkey.sentinel.Sentinel
1216

1317
BrokerConnectionClass: Dict[Tuple[Broker, bool], Type] = {
1418
# Map of (Broker, Strict flag) => Connection Class

0 commit comments

Comments
 (0)