mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 23:54:51 -04:00
Use inline type hints in handlers/
and rest/
. (#10382)
This commit is contained in:
parent
36dc15412d
commit
98aec1cc9d
43 changed files with 212 additions and 215 deletions
|
@ -38,10 +38,10 @@ class BaseHandler:
|
|||
"""
|
||||
|
||||
def __init__(self, hs: "HomeServer"):
|
||||
self.store = hs.get_datastore() # type: synapse.storage.DataStore
|
||||
self.store = hs.get_datastore()
|
||||
self.auth = hs.get_auth()
|
||||
self.notifier = hs.get_notifier()
|
||||
self.state_handler = hs.get_state_handler() # type: synapse.state.StateHandler
|
||||
self.state_handler = hs.get_state_handler()
|
||||
self.distributor = hs.get_distributor()
|
||||
self.clock = hs.get_clock()
|
||||
self.hs = hs
|
||||
|
@ -55,12 +55,12 @@ class BaseHandler:
|
|||
# Check whether ratelimiting room admin message redaction is enabled
|
||||
# by the presence of rate limits in the config
|
||||
if self.hs.config.rc_admin_redaction:
|
||||
self.admin_redaction_ratelimiter = Ratelimiter(
|
||||
self.admin_redaction_ratelimiter: Optional[Ratelimiter] = Ratelimiter(
|
||||
store=self.store,
|
||||
clock=self.clock,
|
||||
rate_hz=self.hs.config.rc_admin_redaction.per_second,
|
||||
burst_count=self.hs.config.rc_admin_redaction.burst_count,
|
||||
) # type: Optional[Ratelimiter]
|
||||
)
|
||||
else:
|
||||
self.admin_redaction_ratelimiter = None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue