SIENTIAPDE-1084
Remove deprecated files and configurations, including .env, Dockerfile, docker-compose.yml, and client-schedule.py. Update README.md to reflect new architecture and features, enhancing clarity on system capabilities and workflows. Adjust values.yaml for image tag and replica count, and improve code documentation across various modules for better maintainability.
This commit is contained in:
@@ -11,8 +11,21 @@ with workflow.unsafe.imports_passed_through():
|
||||
from os import getenv
|
||||
|
||||
|
||||
class Activities(Postgres, Redis, Gates, MongoDB,):
|
||||
"""Activities class that combines multiple services with proper initialization."""
|
||||
class Activities(Postgres, Redis, Gates, MongoDB):
|
||||
"""
|
||||
Unified activities class that combines multiple data processing services.
|
||||
|
||||
This class provides a comprehensive interface for all data processing activities
|
||||
by inheriting from specialized service classes. It handles:
|
||||
- PostgreSQL operations for data persistence
|
||||
- Redis operations for caching and temporary storage
|
||||
- Data quality gates and filtering
|
||||
- MongoDB operations for data retrieval
|
||||
- Notification handling and logging
|
||||
|
||||
The class implements the multiple inheritance pattern to provide a unified
|
||||
interface while maintaining separation of concerns across different data services.
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
postgres_config: dict[str, Any],
|
||||
@@ -20,7 +33,19 @@ class Activities(Postgres, Redis, Gates, MongoDB,):
|
||||
mongodb_config: dict[str, Any],
|
||||
logger: Logger,
|
||||
notification_handler: NotificationHandler):
|
||||
"""
|
||||
Initialize the Activities class with all required services.
|
||||
|
||||
Args:
|
||||
postgres_config (dict[str, Any]): PostgreSQL connection configuration.
|
||||
Required fields: host, port, user, password, dbname, min_connections, max_connections
|
||||
redis_config (dict[str, Any]): Redis connection configuration.
|
||||
Required fields: host, port, username, password
|
||||
mongodb_config (dict[str, Any]): MongoDB connection configuration.
|
||||
Required fields: connection_string, database_name
|
||||
logger (Logger): Logger instance for application logging
|
||||
notification_handler (NotificationHandler): Handler for system notifications
|
||||
"""
|
||||
# Initialize Postgres
|
||||
Postgres.__init__(
|
||||
self,
|
||||
@@ -65,5 +90,11 @@ class Activities(Postgres, Redis, Gates, MongoDB,):
|
||||
self.pod_id = getenv("HOSTNAME", "localhost")
|
||||
|
||||
def shutdown(self):
|
||||
"""
|
||||
Gracefully shutdown all service connections.
|
||||
|
||||
This method ensures proper cleanup of database connections and resources
|
||||
to prevent connection leaks and ensure graceful application termination.
|
||||
"""
|
||||
Postgres.close(self)
|
||||
MongoDB.shutdown(self)
|
||||
|
||||
Reference in New Issue
Block a user