mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 22:04:48 -04:00
Revert change to counting of deactivated users towards the monthly active users limit (#11127)
Temporarily revert "Add functionality to remove deactivated users from the monthly_active_users table (#10947)".
This reverts commit eda8c88b84
.
This commit is contained in:
parent
95813ff43c
commit
df95d3aec2
4 changed files with 4 additions and 62 deletions
|
@ -354,27 +354,3 @@ class MonthlyActiveUsersStore(MonthlyActiveUsersWorkerStore):
|
|||
await self.upsert_monthly_active_user(user_id)
|
||||
elif now - last_seen_timestamp > LAST_SEEN_GRANULARITY:
|
||||
await self.upsert_monthly_active_user(user_id)
|
||||
|
||||
async def remove_deactivated_user_from_mau_table(self, user_id: str) -> None:
|
||||
"""
|
||||
Removes a deactivated user from the monthly active user
|
||||
table and resets affected caches.
|
||||
|
||||
Args:
|
||||
user_id(str): the user_id to remove
|
||||
"""
|
||||
|
||||
rows_deleted = await self.db_pool.simple_delete(
|
||||
table="monthly_active_users",
|
||||
keyvalues={"user_id": user_id},
|
||||
desc="simple_delete",
|
||||
)
|
||||
|
||||
if rows_deleted != 0:
|
||||
await self.invalidate_cache_and_stream(
|
||||
"user_last_seen_monthly_active", (user_id,)
|
||||
)
|
||||
await self.invalidate_cache_and_stream("get_monthly_active_count", ())
|
||||
await self.invalidate_cache_and_stream(
|
||||
"get_monthly_active_count_by_service", ()
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue