SIENTIAPDE-1150

refactor: update notification handler imports to use CoreNotificationHandler across activities and worker, enhancing consistency in notification management
This commit is contained in:
vitor-aignosi
2025-07-16 09:37:50 -03:00
parent 2533ea882f
commit 2fa3a74bcc
8 changed files with 11 additions and 9 deletions

View File

@@ -10,7 +10,7 @@ with workflow.unsafe.imports_passed_through():
from orchestrator.activities.formatters import Formatters
from typing import Any
from logging import Logger
from sientia_do.notifications.handlers import NotificationHandler
from sientia_do.notifications.handlers import CoreNotificationHandler as NotificationHandler
class Activities( # Couchbase,

View File

@@ -9,7 +9,7 @@ with workflow.unsafe.imports_passed_through():
from couchbase.auth import PasswordAuthenticator
from couchbase.cluster import Cluster
from couchbase.options import ClusterOptions
from sientia_do.notifications.handlers import NotificationHandler
from sientia_do.notifications.handlers import CoreNotificationHandler as NotificationHandler
from sientia_do.notifications.models import NotificationLevel
from sientia_do.temporal.activities.base import BaseActivity

View File

@@ -7,7 +7,7 @@ with workflow.unsafe.imports_passed_through():
from typing import Any
from logging import Logger
from datetime import datetime
from sientia_do.notifications.handlers import NotificationHandler
from sientia_do.notifications.handlers import CoreNotificationHandler as NotificationHandler
from sientia_do.temporal.activities.base import BaseActivity
from sientia_do.notifications.models import NotificationLevel
from orchestrator.utils.orchestrator_functions import (

View File

@@ -7,7 +7,7 @@ with workflow.unsafe.imports_passed_through():
import traceback
from logging import Logger
from pymongo import MongoClient
from sientia_do.notifications.handlers import NotificationHandler
from sientia_do.notifications.handlers import CoreNotificationHandler as NotificationHandler
from sientia_do.notifications.models import NotificationLevel
from sientia_do.temporal.activities.base import BaseActivity
from orchestrator.utils.patterns import DEFAULT_DATE_FORMAT

View File

@@ -5,7 +5,7 @@ with workflow.unsafe.imports_passed_through():
import json
from logging import Logger
from sientia_do.temporal.activities.redis_base import Redis
from sientia_do.notifications.handlers import NotificationHandler
from sientia_do.notifications.handlers import CoreNotificationHandler as NotificationHandler
class SlotManager(Redis):

View File

@@ -6,7 +6,7 @@ from temporalio.common import SearchAttributeKey, SearchAttributePair, TypedSear
with workflow.unsafe.imports_passed_through():
from typing import Any
from logging import Logger
from sientia_do.notifications.handlers import NotificationHandler
from sientia_do.notifications.handlers import CoreNotificationHandler as NotificationHandler
from sientia_do.temporal.activities.base import BaseActivity
from google.protobuf.json_format import MessageToDict
import base64

View File

@@ -14,7 +14,7 @@ with workflow.unsafe.imports_passed_through():
build_redis_config,
build_mongodb_config
)
from sientia_do.notifications.handlers import NotificationHandler
from sientia_do.notifications.handlers import CoreNotificationHandler as NotificationHandler
from sientia_do.temporal.utils.logger import get_logger
@@ -26,8 +26,10 @@ async def main():
logger.info('Starting Notification Handler...')
mongo_config = build_mongodb_config()
notification_handler = NotificationHandler(
servers=os.getenv('KAFKA_BOOTSTRAP_SERVERS', 'http://localhost:9092'),
connection_string=mongo_config['connection_string'],
database=mongo_config['database'],
logger=logger,
project_name=os.getenv('PROJECT_NAME', 'orchestrator'),
)