follow-up to #1066: update redis to 5.0.0 which includes full fix for connection leak in from_url(), (#1081)
simplifies previous workaround addressed in 5.0.0
This commit is contained in:
parent
768d1181f8
commit
90b2f94aef
@ -13,8 +13,7 @@ from kubernetes_asyncio.client.api import custom_objects_api
|
||||
from kubernetes_asyncio.utils import create_from_dict
|
||||
from kubernetes_asyncio.client.exceptions import ApiException
|
||||
|
||||
from redis.asyncio import Redis
|
||||
from redis.asyncio.connection import ConnectionPool
|
||||
from redis import asyncio as aioredis
|
||||
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from .utils import get_templates_dir, dt_now, to_k8s_date
|
||||
@ -67,14 +66,9 @@ class K8sAPI:
|
||||
|
||||
async def get_redis_client(self, redis_url):
|
||||
"""return redis client with correct params for one-time use"""
|
||||
# manual settings until redis 5.0.0 is released
|
||||
pool = ConnectionPool.from_url(redis_url, decode_responses=True)
|
||||
redis = Redis(
|
||||
connection_pool=pool,
|
||||
decode_responses=True,
|
||||
return aioredis.from_url(
|
||||
redis_url, decode_responses=True, auto_close_connection_pool=True
|
||||
)
|
||||
redis.auto_close_connection_pool = True
|
||||
return redis
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
async def new_crawl_job(
|
||||
|
@ -5,7 +5,7 @@ loguru
|
||||
aiofiles
|
||||
kubernetes-asyncio==22.6.5
|
||||
aiobotocore
|
||||
redis>=5.0.0rc2
|
||||
redis>=5.0.0
|
||||
pyyaml
|
||||
jinja2
|
||||
humanize
|
||||
|
Loading…
Reference in New Issue
Block a user