summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-04-30 18:16:45 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2020-04-30 18:16:45 +0100
commit2fae76c7b108aafa1c8575967d65648658891b51 (patch)
tree497679b02cdcc9044e88fc4c702a1b5517684bc3 /synapse/handlers
parentEnsure non-federated rooms are not shown for POST /publicRooms (diff)
downloadsynapse-2fae76c7b108aafa1c8575967d65648658891b51.tar.xz
Disable _mark_expired_users_as_inactive bg job when account validity disabled
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/account_validity.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/handlers/account_validity.py b/synapse/handlers/account_validity.py
index f4bf92f775..72baee44c3 100644
--- a/synapse/handlers/account_validity.py
+++ b/synapse/handlers/account_validity.py
@@ -90,8 +90,10 @@ class AccountValidityHandler(object):
 
             self.clock.looping_call(send_emails, 30 * 60 * 1000)
 
-        # Check every hour to remove expired users from the user directory
-        self.clock.looping_call(self._mark_expired_users_as_inactive, 60 * 60 * 1000)
+        # If account_validity is enabled,check every hour to remove expired users from
+        # the user directory
+        if self._account_validity.enabled:
+            self.clock.looping_call(self._mark_expired_users_as_inactive, 60 * 60 * 1000)
 
     async def _send_renewal_emails(self):
         """Gets the list of users whose account is expiring in the amount of time