Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion backend/deepchecks_monitoring/bgtasks/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"""Contains alert scheduling logic."""
import asyncio
import logging
import logging.handlers
import typing as t
from collections import defaultdict
from contextlib import asynccontextmanager
Expand Down
2 changes: 1 addition & 1 deletion backend/deepchecks_monitoring/bgtasks/tasks_queuer.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ async def main():

async with ResourcesProvider(settings) as rp:
async with anyio.create_task_group() as g:
async_redis = await init_async_redis(rp.redis_settings)
async_redis = await init_async_redis()
worker = tasks_queuer.TasksQueuer(rp, async_redis, workers, logger, settings.queuer_run_interval)
g.start_soon(worker.run)

Expand Down
1 change: 0 additions & 1 deletion backend/deepchecks_monitoring/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ class RedisSettings(BaseDeepchecksSettings):
"""Redis settings."""

redis_uri: t.Optional[RedisDsn] = None
decode_responses: bool = True
socket_connect_timeout: int = 5
socket_timeout: int = 5
socket_keepalive: bool = True
Expand Down
4 changes: 2 additions & 2 deletions backend/deepchecks_monitoring/utils/redis_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ def create_settings_dict(redis_settings: RedisSettings):

return dict(
url=redis_settings.redis_uri,
decode_responses=redis_settings.decode_responses,
socket_connect_timeout=redis_settings.socket_connect_timeout,
socket_timeout=redis_settings.socket_timeout,
socket_keepalive=redis_settings.socket_keepalive,
retry=Retry(ExponentialBackoff(), redis_settings.retry_attempts),
)


async def init_async_redis(redis_settings: RedisSettings):
async def init_async_redis(redis_settings: RedisSettings | None = None):
"""Initialize redis connection."""
redis_settings = redis_settings or RedisSettings()
settings = create_settings_dict(redis_settings)
try:
redis = AsyncRedisCluster.from_url(
Expand Down
2 changes: 1 addition & 1 deletion backend/dev_utils/run_task_directly.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def run_it():
async with rp.create_async_database_session() as session:

try:
async_redis = await init_async_redis(rp.redis_settings)
async_redis = await init_async_redis()

lock_name = TASK_RUNNER_LOCK.format(1)
# By default, allow task 5 minutes before removes lock to allow another run. Inside the task itself we can
Expand Down
Loading