[MISC] Move Redis clients to unstract-core for better code organization (#1613)

- Moved redis_client.py and redis_queue_client.py from workers/shared/cache/ to unstract/core/src/unstract/core/cache/
- Created new cache module in unstract-core with __init__.py exports
- Updated all import statements across workers to use unstract.core.cache instead of shared.cache
- Updated imports in log_consumer tasks and cache_backends to use new location
- Maintains backward compatibility by keeping same API and functionality
This commit is contained in:
Chandrasekharan M
2025-10-27 10:52:10 +05:30
committed by GitHub
parent a08020a98b
commit 7d1a01b605
6 changed files with 14 additions and 4 deletions

View File

@@ -0,0 +1,9 @@
"""Redis Cache Clients for Unstract.
This module provides Redis client implementations for caching and queue operations.
"""
from .redis_client import RedisClient
from .redis_queue_client import RedisQueueClient
__all__ = ["RedisClient", "RedisQueueClient"]

View File

@@ -7,7 +7,7 @@ Inherits from RedisClient for basic Redis functionality.
import logging
from typing import Any
from .redis_client import RedisClient
from unstract.core.cache.redis_client import RedisClient
logger = logging.getLogger(__name__)

View File

@@ -17,7 +17,8 @@ import os
import sys
import httpx
from shared.cache.redis_queue_client import RedisQueueClient
from unstract.core.cache.redis_queue_client import RedisQueueClient
logger = logging.getLogger(__name__)

View File

@@ -8,11 +8,11 @@ from typing import Any
import socketio
from celery import shared_task
from shared.cache.redis_queue_client import RedisQueueClient
from shared.infrastructure.config import WorkerConfig
from shared.infrastructure.logging import WorkerLogger
from shared.utils.api_client_singleton import get_singleton_api_client
from unstract.core.cache.redis_queue_client import RedisQueueClient
from unstract.core.constants import LogEventArgument, LogProcessingTask
from unstract.core.log_utils import store_execution_log

View File

@@ -11,7 +11,7 @@ from abc import ABC, abstractmethod
from datetime import UTC, datetime
from typing import Any
from .redis_client import RedisClient
from unstract.core.cache.redis_client import RedisClient
logger = logging.getLogger(__name__)