Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
run: |
python -m pip --quiet install poetry
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
poetry install -E yaml
poetry install -E yaml -E valkey
poetry run pip install django==${{ matrix.django-version }}

- name: Get version
Expand Down
123 changes: 114 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ croniter = ">=2.0"
click = "^8.1"
rq = "^1.16"
pyyaml = { version = "^6.0", optional = true }
valkey = "6.0.1"
valkey = { version = "^6.0.2", optional = true}
libvalkey = { version = "^4.0.0", optional = true}

[tool.poetry.dev-dependencies]
poetry = "^1.8.3"
Expand All @@ -60,6 +61,8 @@ freezegun = "^1.5"

[tool.poetry.extras]
yaml = ["pyyaml"]
valkey = ["valkey"]
valkey_full = ["valkey","libvalkey"]

[tool.flake8]
max-line-length = 120
Expand Down
7 changes: 6 additions & 1 deletion scheduler/connection_types.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
from typing import Union, Dict, Tuple, Type

import redis
import valkey
try:
import valkey
except ImportError:
valkey = redis
valkey.Valkey = redis.Redis

from scheduler.settings import Broker

ConnectionErrorType = Union[redis.ConnectionError, valkey.ConnectionError]
ConnectionType = Union[redis.Redis, valkey.Valkey]
PipelineType = Union[redis.client.Pipeline, valkey.client.Pipeline]
RedisSentinel = redis.sentinel.Sentinel
ValkeySentinel = valkey.sentinel.Sentinel

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