Allow for custom mail recipients in luigi crontab

This commit is contained in:
Lance Edgar 2023-01-08 13:04:46 -06:00
parent 6fb9389e45
commit d68b57baa8
2 changed files with 7 additions and 2 deletions

View file

@ -1,4 +1,8 @@
## -*- mode: conf; -*-
% if mailto:
MAILTO="${','.join(mailto)}"
% endif
# rotate logs and restart Luigi at *just before* 12:00am midnight
55 23 * * * root ${appdir}/rotate-luigi-logs.sh

View file

@ -33,7 +33,7 @@ deploy_common = make_deploy(__file__)
def install_luigi(c, envroot, luigi='luigi', user='rattail', db_connection=None,
crontab=False):
crontab=False, crontab_mailto=None):
"""
Install and configure Luigi to the given virtualenv.
"""
@ -73,7 +73,8 @@ def install_luigi(c, envroot, luigi='luigi', user='rattail', db_connection=None,
context={'appdir': appdir})
if crontab:
deploy_common(c, 'luigi/crontab.mako', '/etc/cron.d/luigi',
use_sudo=True, context={'appdir': appdir})
use_sudo=True, context={'appdir': appdir,
'mailto': crontab_mailto})
def install_overnight_script(c, envroot, user='rattail', automation='All',