fix notification.emit return to return coro incase we don't have any targets.
This commit is contained in:
parent
c46aa1cfe4
commit
37ef9314cb
1 changed files with 2 additions and 5 deletions
|
|
@ -389,11 +389,8 @@ class Notification(metaclass=Singleton):
|
||||||
return {"url": target.request.url, "status": 500, "text": str(ev)}
|
return {"url": target.request.url, "status": 500, "text": str(ev)}
|
||||||
|
|
||||||
def emit(self, e: Event, _, **kwargs): # noqa: ARG002
|
def emit(self, e: Event, _, **kwargs): # noqa: ARG002
|
||||||
if len(self._targets) < 1:
|
if len(self._targets) < 1 or not NotificationEvents.is_valid(e.event):
|
||||||
return []
|
return asyncio.sleep(0)
|
||||||
|
|
||||||
if not NotificationEvents.is_valid(e.event):
|
|
||||||
return []
|
|
||||||
|
|
||||||
return self.send(e)
|
return self.send(e)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue