From 2fae76c7b108aafa1c8575967d65648658891b51 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 30 Apr 2020 18:16:45 +0100 Subject: Disable _mark_expired_users_as_inactive bg job when account validity disabled --- synapse/handlers/account_validity.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'synapse/handlers') 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 -- cgit 1.5.1