diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-03-24 06:48:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 06:48:46 -0400 |
commit | 7e8dc9934e29ebd5f30f42b4b6e6b4491569373a (patch) | |
tree | 7b4f23523a627b04cb4b61c1c24ec9ec4ff03893 /synapse/server_notices/server_notices_sender.py | |
parent | Increase default join burst ratelimiting (#9674) (diff) | |
download | synapse-7e8dc9934e29ebd5f30f42b4b6e6b4491569373a.tar.xz |
Add a type hints for service notices to the HomeServer object. (#9675)
Diffstat (limited to 'synapse/server_notices/server_notices_sender.py')
-rw-r--r-- | synapse/server_notices/server_notices_sender.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/synapse/server_notices/server_notices_sender.py b/synapse/server_notices/server_notices_sender.py index 6870b67ca0..965c645889 100644 --- a/synapse/server_notices/server_notices_sender.py +++ b/synapse/server_notices/server_notices_sender.py @@ -12,25 +12,27 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import Iterable, Union +from typing import TYPE_CHECKING, Iterable, Union from synapse.server_notices.consent_server_notices import ConsentServerNotices from synapse.server_notices.resource_limits_server_notices import ( ResourceLimitsServerNotices, ) +from synapse.server_notices.worker_server_notices_sender import ( + WorkerServerNoticesSender, +) + +if TYPE_CHECKING: + from synapse.server import HomeServer -class ServerNoticesSender: +class ServerNoticesSender(WorkerServerNoticesSender): """A centralised place which sends server notices automatically when Certain Events take place """ - def __init__(self, hs): - """ - - Args: - hs (synapse.server.HomeServer): - """ + def __init__(self, hs: "HomeServer"): + super().__init__(hs) self._server_notices = ( ConsentServerNotices(hs), ResourceLimitsServerNotices(hs), |