This commit is contained in:
Iain Learmonth 2023-01-21 15:15:07 +00:00
parent 6df0083842
commit 10ffdff2c3
14 changed files with 46 additions and 16 deletions

View file

@ -124,11 +124,11 @@ def run_job(job_cls: Type[BaseAutomation], *,
trace = TracebackException.from_exception(exc)
success = False
logs = "\n".join(trace.format())
if success:
if job is not None and success:
automation.state = AutomationState.IDLE
automation.next_run = datetime.datetime.utcnow() + datetime.timedelta(
minutes=getattr(job, "frequency", 7))
if 'TERRAFORM_DIRECTORY' not in app.config:
if 'TERRAFORM_DIRECTORY' not in app.config and working_dir is not None:
# We used a temporary working directory
shutil.rmtree(working_dir)
else: