soft-deactivation: Add cron job for weekly soft deactivating users.

This commit is contained in:
Aditya Bansal 2017-08-22 06:16:19 +05:30 committed by Tim Abbott
parent 9d7e23c100
commit b232563e12
3 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,6 @@
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
USER=zulip
# Cron job to soft deactivate long term idle users weekly.
0 5 * * 7 zulip /home/zulip/deployments/current/manage.py soft_activate_deactivate_users -d >/dev/null

View File

@ -44,4 +44,13 @@ class zulip::app_frontend {
mode => 644,
source => "puppet:///modules/zulip/cron.d/restart-zulip",
}
# Soft deactivate long term idle users weekly.
file { "/etc/cron.d/soft-deactivate-users":
ensure => file,
owner => "root",
group => "root",
mode => 644,
source => "puppet:///modules/zulip/cron.d/soft-deactivate-users",
}
}

View File

@ -42,6 +42,10 @@ class Command(ZulipBaseCommand):
def handle(self, *args, **options):
# type: (*Any, **str) -> None
if settings.STAGING:
print('This is a Staging server. Suppressing management command.')
sys.exit(0)
if options['realm_id']:
realm = self.get_realm(options)
filter_kwargs = {} # type: Dict[str, Realm]