settings: Add option to disable email deliverer.

This commit is contained in:
Tim Abbott 2016-08-12 19:24:45 -07:00
parent 0c3e98fa91
commit 3bae3cd54d
2 changed files with 7 additions and 0 deletions

View File

@ -72,6 +72,12 @@ Usage: python manage.py deliver_email
def handle(self, *args, **options):
# TODO: this only acquires a lock on the system, not on the DB:
# be careful not to run this on multiple systems.
# In the meantime, we have an option to prevent this job from
# running on >1 machine
if settings.EMAIL_DELIVERER_DISABLED:
return
with lockfile("/tmp/zulip_email_deliver.lockfile"):
while True:
# make sure to use utcnow, otherwise it gets confused when you set the time with utcnow(),

View File

@ -144,6 +144,7 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
'ENABLE_FEEDBACK': PRODUCTION,
'FEEDBACK_EMAIL': None,
'WELCOME_EMAIL_SENDER': None,
'EMAIL_DELIVERER_DISABLED': False,
'ENABLE_GRAVATAR': True,
'DEFAULT_AVATAR_URI': '/static/images/default-avatar.png',
'AUTH_LDAP_SERVER_URI': "",