From 6708163271b0e274c3c0106b31e8fe27a50b48df Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Fri, 19 Jun 2020 16:14:37 +0100 Subject: Performance improvements to marking expired users as inactive (#47) This is a performance-related improvement to #13, which queried and hid active *and* already inactive users, one-by-one. This PR updates the code to query only **active**, expired users, all at once, and then mark them as inactive, all at once. --- synapse/rest/client/v2_alpha/account_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'synapse/rest') diff --git a/synapse/rest/client/v2_alpha/account_data.py b/synapse/rest/client/v2_alpha/account_data.py index ddb011d864..d31ec7c29d 100644 --- a/synapse/rest/client/v2_alpha/account_data.py +++ b/synapse/rest/client/v2_alpha/account_data.py @@ -55,7 +55,7 @@ class AccountDataServlet(RestServlet): if account_data_type == "im.vector.hide_profile": user = UserID.from_string(user_id) hide_profile = body.get("hide_profile") - await self._profile_handler.set_active(user, not hide_profile, True) + await self._profile_handler.set_active([user], not hide_profile, True) max_id = await self.store.add_account_data_for_user( user_id, account_data_type, body -- cgit 1.5.1