Skip to content

Commit 02be423

Browse files
feat: refactor models
1 parent 217d6a5 commit 02be423

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

services/notifications/src/simcore_service_notifications/models/schemas.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ class EmailRecipient(BaseModel):
1515

1616

1717
class NotificationMessage(BaseModel):
18-
recipients: list[Recipient]
1918
event: str
2019
context: dict[str, Any] | None = None
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from ...models.schemas import EmailRecipient, NotificationMessage
2+
3+
4+
async def send_email_notification(
5+
message: NotificationMessage, recipient: EmailRecipient
6+
) -> None:
7+
pass

services/notifications/src/simcore_service_notifications/modules/celery/worker_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
assert _settings.NOTIFICATIONS_CELERY # nosec
29-
app = create_celery_app(_settings.NOTIFICATIONS_CELERY)
29+
the_celery_app = create_celery_app(_settings.NOTIFICATIONS_CELERY)
3030

3131
app_server = FastAPIAppServer(app=create_app())
3232

@@ -41,4 +41,4 @@ def worker_init_wrapper(sender, **_kwargs):
4141
worker_init.connect(worker_init_wrapper)
4242
worker_shutdown.connect(on_worker_shutdown)
4343

44-
setup_worker_tasks(app)
44+
setup_worker_tasks(the_celery_app)
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from ..models.schemas import NotificationMessage
1+
from ..models.schemas import NotificationMessage, Recipient
22

33

4-
async def send_notification_message(message: NotificationMessage) -> None: ...
4+
async def send_notification(
5+
message: NotificationMessage, *recipients: list[Recipient]
6+
) -> None: ...

0 commit comments

Comments
 (0)