Update mautrix-python
This commit is contained in:
@@ -64,7 +64,6 @@ class User(AbstractUser, BaseUser):
|
|||||||
|
|
||||||
_db_instance: Optional[DBUser]
|
_db_instance: Optional[DBUser]
|
||||||
_ensure_started_lock: asyncio.Lock
|
_ensure_started_lock: asyncio.Lock
|
||||||
_metric_value: Dict[Gauge, bool]
|
|
||||||
_track_connection_task: Optional[asyncio.Task]
|
_track_connection_task: Optional[asyncio.Task]
|
||||||
|
|
||||||
def __init__(self, mxid: UserID, tgid: Optional[TelegramID] = None,
|
def __init__(self, mxid: UserID, tgid: Optional[TelegramID] = None,
|
||||||
@@ -200,14 +199,6 @@ class User(AbstractUser, BaseUser):
|
|||||||
async with self._ensure_started_lock:
|
async with self._ensure_started_lock:
|
||||||
return cast(User, await super().ensure_started(even_if_no_session))
|
return cast(User, await super().ensure_started(even_if_no_session))
|
||||||
|
|
||||||
def _track_metric(self, metric: Gauge, value: bool) -> None:
|
|
||||||
if self._metric_value[metric] != value:
|
|
||||||
if value:
|
|
||||||
metric.inc(1)
|
|
||||||
else:
|
|
||||||
metric.dec(1)
|
|
||||||
self._metric_value[metric] = value
|
|
||||||
|
|
||||||
async def start(self, delete_unless_authenticated: bool = False) -> 'User':
|
async def start(self, delete_unless_authenticated: bool = False) -> 'User':
|
||||||
await super().start()
|
await super().start()
|
||||||
self._track_metric(METRIC_CONNECTED, True)
|
self._track_metric(METRIC_CONNECTED, True)
|
||||||
|
|||||||
+1
-1
@@ -5,6 +5,6 @@ python-magic>=0.4,<0.5
|
|||||||
commonmark>=0.8,<0.10
|
commonmark>=0.8,<0.10
|
||||||
aiohttp>=3,<3.7
|
aiohttp>=3,<3.7
|
||||||
yarl<1.6
|
yarl<1.6
|
||||||
mautrix==0.8.0.beta4
|
mautrix==0.8.0.beta7
|
||||||
telethon>=1.16,<1.17
|
telethon>=1.16,<1.17
|
||||||
telethon-session-sqlalchemy>=0.2.14,<0.3
|
telethon-session-sqlalchemy>=0.2.14,<0.3
|
||||||
|
|||||||
Reference in New Issue
Block a user