Update requirements.txt with new dependencies and refactor activity methods for improved functionality and error handling
17 lines
681 B
Python
17 lines
681 B
Python
from temporalio import activity
|
|
from sientia_do.notifications.handlers import NotificationHandler
|
|
from logging import Logger
|
|
|
|
|
|
class BaseActivity:
|
|
def __init__(self, logger: Logger, notification_handler: NotificationHandler):
|
|
self.logger = logger
|
|
self.notification_handler = notification_handler
|
|
|
|
def prepare_activity(self, schedule_name: str,
|
|
model_name: str,
|
|
model_id: str):
|
|
self.notification_handler.base_notification.schedule_name = schedule_name
|
|
self.notification_handler.base_notification.model_name = model_name
|
|
self.notification_handler.base_notification.model_id = model_id
|