Skip to content

Commit

Permalink
Merge pull request #172 from Krukov/fix-redis-close-connection
Browse files Browse the repository at this point in the history
fix: skip redis=5.0.1 version as broken and close connection pool
  • Loading branch information
Krukov authored Dec 2, 2023
2 parents 985f0d2 + 996f036 commit 409d60d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ jobs:
run: |
tox -e py-redis
- name: Redis Test Suit (4)
env:
REDIS_HOST: localhost
REDIS_PORT: 6379
run: |
tox -e py-redis4
- name: Diskcache Test Suit
run: |
tox -e py-diskcache
Expand Down
2 changes: 1 addition & 1 deletion cashews/backends/redis/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,5 @@ async def get_keys_count(self) -> int:
return await self._client.dbsize()

async def close(self):
await self._client.close()
await self._client.close(close_connection_pool=True)
self.__is_init = False
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cashews = py.typed

[options.extras_require]
redis =
redis >= 4.3.1
redis >= 4.3.1,!=5.0.1
diskcache =
diskcache >= 5.0.0
speedup =
Expand Down
4 changes: 4 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
envlist =
{py38,py39,py310,py311}
{py38,py39,py310,py311}-redis
{py38,py39,py310,py311}-redis4
{py38,py39,py310,py311}-diskcache
{py38,py39,py310,py311}-integration
coverage
Expand All @@ -13,6 +14,7 @@ setenv =
COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
MARKER = not redis and not integration and not diskcache
{py,py38,py39,py310,py311}-redis: MARKER = redis and not diskcache
{py,py38,py39,py310,py311}-redis4: MARKER = redis and not diskcache
{py,py38,py39,py310,py311}-diskcache: MARKER = diskcache and not redis
{py,py38,py39,py310,py311}-integration: MARKER = integration
deps =
Expand All @@ -21,6 +23,7 @@ deps =
pytest-cov
pytest-rerunfailures
hypothesis
{py,py38,py39,py310,py311}-redis4: redis==4.6.0
{py,py38,py39,py310,py311}-integration: aiohttp
{py,py38,py39,py310,py311}-integration: fastapi
{py,py38,py39,py310,py311}-integration: httpx
Expand Down Expand Up @@ -48,5 +51,6 @@ commands =
depends =
{py38,py39,py310,py311}
{py38,py39,py310,py311}-redis
{py38,py39,py310,py311}-redis4
{py38,py39,py310,py311}-diskcache
{py38,py39,py310,py311}-integration

0 comments on commit 409d60d

Please sign in to comment.