Bladeren bron

Update mautrix-python

Tulir Asokan 4 jaren geleden
bovenliggende
commit
4b6217f3cb
4 gewijzigde bestanden met toevoegingen van 7 en 6 verwijderingen
  1. 2 0
      mautrix_instagram/example-config.yaml
  2. 2 3
      mautrix_instagram/portal.py
  3. 1 1
      optional-requirements.txt
  4. 2 2
      requirements.txt

+ 2 - 0
mautrix_instagram/example-config.yaml

@@ -8,6 +8,8 @@ homeserver:
     # Only applies if address starts with https://
     # Only applies if address starts with https://
     verify_ssl: true
     verify_ssl: true
     asmux: false
     asmux: false
+    # Number of retries for all HTTP requests if the homeserver isn't reachable.
+    http_retry_count: 4
 
 
 # Application service host/registration related details
 # Application service host/registration related details
 # Changing these values requires regeneration of the registration.
 # Changing these values requires regeneration of the registration.

+ 2 - 3
mautrix_instagram/portal.py

@@ -34,7 +34,6 @@ from mautrix.types import (EventID, MessageEventContent, RoomID, EventType, Mess
                            ContentURI, EncryptedFile, LocationMessageEventContent, Format, UserID)
                            ContentURI, EncryptedFile, LocationMessageEventContent, Format, UserID)
 from mautrix.errors import MatrixError, MForbidden, MNotFound, SessionNotFound
 from mautrix.errors import MatrixError, MForbidden, MNotFound, SessionNotFound
 from mautrix.util.simple_lock import SimpleLock
 from mautrix.util.simple_lock import SimpleLock
-from mautrix.util.network_retry import call_with_net_retry
 
 
 from .db import Portal as DBPortal, Message as DBMessage, Reaction as DBReaction
 from .db import Portal as DBPortal, Message as DBMessage, Reaction as DBReaction
 from .config import Config
 from .config import Config
@@ -369,8 +368,8 @@ class Portal(DBPortal, BasePortal):
             upload_mime_type = "application/octet-stream"
             upload_mime_type = "application/octet-stream"
             upload_file_name = None
             upload_file_name = None
 
 
-        mxc = await call_with_net_retry(intent.upload_media, data, mime_type=upload_mime_type,
-                                        filename=upload_file_name, _action="upload media")
+        mxc = await intent.upload_media(data, mime_type=upload_mime_type,
+                                        filename=upload_file_name)
 
 
         if decryption_info:
         if decryption_info:
             decryption_info.url = mxc
             decryption_info.url = mxc

+ 1 - 1
optional-requirements.txt

@@ -6,7 +6,7 @@ python-olm>=3,<4
 unpaddedbase64>=1,<2
 unpaddedbase64>=1,<2
 
 
 #/metrics
 #/metrics
-prometheus_client>=0.6,<0.10
+prometheus_client>=0.6,<0.11
 
 
 #/imageconvert
 #/imageconvert
 pillow>=4,<9
 pillow>=4,<9

+ 2 - 2
requirements.txt

@@ -1,10 +1,10 @@
-ruamel.yaml>=0.15.35,<0.17
+ruamel.yaml>=0.15.35,<0.18
 python-magic>=0.4,<0.5
 python-magic>=0.4,<0.5
 commonmark>=0.8,<0.10
 commonmark>=0.8,<0.10
 aiohttp>=3,<4
 aiohttp>=3,<4
 yarl>=1,<2
 yarl>=1,<2
 attrs>=20.1
 attrs>=20.1
-mautrix>=0.8.14,<0.9
+mautrix>=0.9,<0.10
 asyncpg>=0.20,<0.23
 asyncpg>=0.20,<0.23
 pycryptodome>=3,<4
 pycryptodome>=3,<4
 paho-mqtt>=1.5,<2
 paho-mqtt>=1.5,<2