From: Michael Tremer Date: Sun, 26 Jan 2025 10:35:34 +0000 (+0000) Subject: users: Send push messages from the same task X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22238638ce0b2b8dbcbfd26f75b239ea6e7850ac;p=pbs.git users: Send push messages from the same task This is necessary because SQLAlchemy cannot delete the push notification from a different task. Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/users.py b/src/buildservice/users.py index 6d098ae5..23f7abf3 100644 --- a/src/buildservice/users.py +++ b/src/buildservice/users.py @@ -985,9 +985,8 @@ class User(database.Base, database.BackendMixin, database.SoftDeleteMixin): message = self._make_message(title, body, **kwargs) # Send the message to all subscriptions - async with asyncio.TaskGroup() as tg: - for subscription in self.subscriptions: - tg.create_task(subscription.send(message)) + for subscription in subscriptions: + await subscription.send(message) return True