From 37ef9314cbaa84b6e0449bee135585ed88b07129 Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Sun, 23 Mar 2025 00:46:24 +0300 Subject: [PATCH] fix notification.emit return to return coro incase we don't have any targets. --- app/library/Notifications.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/library/Notifications.py b/app/library/Notifications.py index add6eefd..80230ab8 100644 --- a/app/library/Notifications.py +++ b/app/library/Notifications.py @@ -389,11 +389,8 @@ class Notification(metaclass=Singleton): return {"url": target.request.url, "status": 500, "text": str(ev)} def emit(self, e: Event, _, **kwargs): # noqa: ARG002 - if len(self._targets) < 1: - return [] - - if not NotificationEvents.is_valid(e.event): - return [] + if len(self._targets) < 1 or not NotificationEvents.is_valid(e.event): + return asyncio.sleep(0) return self.send(e)