Keep current rattail config, when launching overnight task

at least i think this makes the most sense..?
This commit is contained in:
Lance Edgar 2022-11-27 12:33:44 -06:00
parent 2e4bb53d67
commit 151f92c00a

View file

@ -184,7 +184,7 @@ class LuigiHandler(GenericHandler):
appdir = self.config.appdir() appdir = self.config.appdir()
env = { env = {
'PYTHONPATH': appdir, 'PYTHONPATH': appdir,
'RATTAIL_CONFIG_FILES': os.path.join(appdir, 'silent.conf'), 'RATTAIL_CONFIG_FILES': os.pathsep.join(self.config.files_read),
} }
# build our command, which will vary per caller request. by # build our command, which will vary per caller request. by
@ -198,7 +198,6 @@ class LuigiHandler(GenericHandler):
# rattail overnight <task> # rattail overnight <task>
cmd = [ cmd = [
'{}/bin/rattail'.format(sys.prefix), '{}/bin/rattail'.format(sys.prefix),
'--config', '{}/silent.conf'.format(appdir),
'--no-versioning', '--no-versioning',
'overnight', '-k', task['key'], 'overnight', '-k', task['key'],
'--date={}'.format(date), '--date={}'.format(date),
@ -234,7 +233,6 @@ class LuigiHandler(GenericHandler):
# rattail run-n-mail 'task command' # rattail run-n-mail 'task command'
cmd = [ cmd = [
os.path.join(sys.prefix, 'bin', 'rattail'), os.path.join(sys.prefix, 'bin', 'rattail'),
'--config', os.path.join(appdir, 'silent.conf'),
'--no-versioning', '--no-versioning',
'run-n-mail', 'run-n-mail',
'--keep-exit-code', '--keep-exit-code',
@ -247,6 +245,7 @@ class LuigiHandler(GenericHandler):
cmd.append('--skip-if-empty') cmd.append('--skip-if-empty')
# log final command # log final command
log.debug("env is: %s", env)
log.debug("launching command in subprocess: %s", cmd) log.debug("launching command in subprocess: %s", cmd)
if dry_run: if dry_run:
log.debug("dry-run mode, so aborting") log.debug("dry-run mode, so aborting")