Add type hints for most HomeServer parameters (#11095)

This commit is contained in:
Sean Quah 2021-10-22 18:15:41 +01:00 committed by GitHub
parent b9ce53e878
commit 2b82ec425f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 342 additions and 143 deletions

View file

@ -14,7 +14,7 @@
import calendar
import logging
import time
from typing import Dict
from typing import TYPE_CHECKING, Dict
from synapse.metrics import GaugeBucketCollector
from synapse.metrics.background_process_metrics import wrap_as_background_process
@ -24,6 +24,9 @@ from synapse.storage.databases.main.event_push_actions import (
EventPushActionsWorkerStore,
)
if TYPE_CHECKING:
from synapse.server import HomeServer
logger = logging.getLogger(__name__)
# Collect metrics on the number of forward extremities that exist.
@ -52,7 +55,7 @@ class ServerMetricsStore(EventPushActionsWorkerStore, SQLBaseStore):
stats and prometheus metrics.
"""
def __init__(self, database: DatabasePool, db_conn, hs):
def __init__(self, database: DatabasePool, db_conn, hs: "HomeServer"):
super().__init__(database, db_conn, hs)
# Read the extrems every 60 minutes