Skip to content

Commit 7d1a01b

Browse files
[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
1 parent a08020a commit 7d1a01b

6 files changed

Lines changed: 14 additions & 4 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Redis Cache Clients for Unstract.
2+
3+
This module provides Redis client implementations for caching and queue operations.
4+
"""
5+
6+
from .redis_client import RedisClient
7+
from .redis_queue_client import RedisQueueClient
8+
9+
__all__ = ["RedisClient", "RedisQueueClient"]
File renamed without changes.

workers/shared/cache/redis_queue_client.py renamed to unstract/core/src/unstract/core/cache/redis_queue_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import logging
88
from typing import Any
99

10-
from .redis_client import RedisClient
10+
from unstract.core.cache.redis_client import RedisClient
1111

1212
logger = logging.getLogger(__name__)
1313

workers/log_consumer/process_log_history.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
import sys
1818

1919
import httpx
20-
from shared.cache.redis_queue_client import RedisQueueClient
20+
21+
from unstract.core.cache.redis_queue_client import RedisQueueClient
2122

2223
logger = logging.getLogger(__name__)
2324

workers/log_consumer/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
import socketio
1010
from celery import shared_task
11-
from shared.cache.redis_queue_client import RedisQueueClient
1211
from shared.infrastructure.config import WorkerConfig
1312
from shared.infrastructure.logging import WorkerLogger
1413
from shared.utils.api_client_singleton import get_singleton_api_client
1514

15+
from unstract.core.cache.redis_queue_client import RedisQueueClient
1616
from unstract.core.constants import LogEventArgument, LogProcessingTask
1717
from unstract.core.log_utils import store_execution_log
1818

workers/shared/cache/cache_backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from datetime import UTC, datetime
1212
from typing import Any
1313

14-
from .redis_client import RedisClient
14+
from unstract.core.cache.redis_client import RedisClient
1515

1616
logger = logging.getLogger(__name__)
1717

0 commit comments

Comments
 (0)