mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 10:14:49 -04:00
Use direct references for configuration variables (part 6). (#10916)
This commit is contained in:
parent
8cef1ab2ac
commit
94b620a5ed
54 changed files with 141 additions and 132 deletions
|
@ -32,8 +32,8 @@ class MonthlyActiveUsersWorkerStore(SQLBaseStore):
|
|||
self._clock = hs.get_clock()
|
||||
self.hs = hs
|
||||
|
||||
self._limit_usage_by_mau = hs.config.limit_usage_by_mau
|
||||
self._max_mau_value = hs.config.max_mau_value
|
||||
self._limit_usage_by_mau = hs.config.server.limit_usage_by_mau
|
||||
self._max_mau_value = hs.config.server.max_mau_value
|
||||
|
||||
@cached(num_args=0)
|
||||
async def get_monthly_active_count(self) -> int:
|
||||
|
@ -96,8 +96,8 @@ class MonthlyActiveUsersWorkerStore(SQLBaseStore):
|
|||
"""
|
||||
users = []
|
||||
|
||||
for tp in self.hs.config.mau_limits_reserved_threepids[
|
||||
: self.hs.config.max_mau_value
|
||||
for tp in self.hs.config.server.mau_limits_reserved_threepids[
|
||||
: self.hs.config.server.max_mau_value
|
||||
]:
|
||||
user_id = await self.hs.get_datastore().get_user_id_by_threepid(
|
||||
tp["medium"], tp["address"]
|
||||
|
@ -212,7 +212,7 @@ class MonthlyActiveUsersStore(MonthlyActiveUsersWorkerStore):
|
|||
def __init__(self, database: DatabasePool, db_conn, hs):
|
||||
super().__init__(database, db_conn, hs)
|
||||
|
||||
self._mau_stats_only = hs.config.mau_stats_only
|
||||
self._mau_stats_only = hs.config.server.mau_stats_only
|
||||
|
||||
# Do not add more reserved users than the total allowable number
|
||||
self.db_pool.new_transaction(
|
||||
|
@ -221,7 +221,7 @@ class MonthlyActiveUsersStore(MonthlyActiveUsersWorkerStore):
|
|||
[],
|
||||
[],
|
||||
self._initialise_reserved_users,
|
||||
hs.config.mau_limits_reserved_threepids[: self._max_mau_value],
|
||||
hs.config.server.mau_limits_reserved_threepids[: self._max_mau_value],
|
||||
)
|
||||
|
||||
def _initialise_reserved_users(self, txn, threepids):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue