[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:
committed by
GitHub
parent
a08020a98b
commit
7d1a01b605
9
unstract/core/src/unstract/core/cache/__init__.py
vendored
Normal file
9
unstract/core/src/unstract/core/cache/__init__.py
vendored
Normal 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"]
|
||||
@@ -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__)
|
||||
|
||||
@@ -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__)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
2
workers/shared/cache/cache_backends.py
vendored
2
workers/shared/cache/cache_backends.py
vendored
@@ -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__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user