Browse Source

Log errors when updating portal metadata

Tulir Asokan 2 years ago
parent
commit
3cbdac88e7
1 changed files with 7 additions and 1 deletions
  1. 7 1
      mautrix_signal/puppet.py

+ 7 - 1
mautrix_signal/puppet.py

@@ -204,7 +204,7 @@ class Puppet(DBPuppet, BasePuppet):
                 update = await self._update_avatar(f"contact-{self.number}") or update
             if update:
                 await self.update()
-                asyncio.create_task(self._update_portal_meta())
+                asyncio.create_task(self._try_update_portal_meta())
 
     @staticmethod
     def fmt_phone(number: str) -> str:
@@ -314,6 +314,12 @@ class Puppet(DBPuppet, BasePuppet):
             self.avatar_set = False
         return True
 
+    async def _try_update_portal_meta(self) -> None:
+        try:
+            await self._update_portal_meta()
+        except Exception:
+            self.log.exception("Error updating portal meta")
+
     async def _update_portal_meta(self) -> None:
         async for portal in p.Portal.find_private_chats_with(self.uuid):
             if portal.receiver == self.number: