forked from 3wordchant/capsul-flask
log inconsistency warning email
This commit is contained in:
parent
e2c51d067e
commit
f74a361c5f
@ -268,6 +268,11 @@ def ensure_vms_and_db_are_synced():
|
||||
if len(errors) > 0:
|
||||
email_addresses_raw = current_app.config['ADMIN_EMAIL_ADDRESSES'].split(",")
|
||||
email_addresses = list(filter(lambda x: len(x) > 6, map(lambda x: x.strip(), email_addresses_raw ) ))
|
||||
|
||||
current_app.logger.info(f"cron_task: sending inconsistency warning email to {','.join(email_addresses)}:")
|
||||
for error in errors:
|
||||
current_app.logger.info(f"cron_task: {error}.")
|
||||
|
||||
current_app.config["FLASK_MAIL_INSTANCE"].send(
|
||||
Message(
|
||||
"Capsul Consistency Check Failed",
|
||||
|
Loading…
Reference in New Issue
Block a user