automate: add flash activity to db session

This commit is contained in:
Iain Learmonth 2022-05-16 14:06:07 +01:00
parent e163c58445
commit 827aab6ffb

View file

@ -114,6 +114,7 @@ def run_job(job_cls: Type[BaseAutomation], *,
activity_type="automation",
text=f"FLASH! Automation Failure: {automation.short_name}. See logs for details."
)
db.session.add(activity)
activity.notify() # Notify before commit because the failure occurred even if we can't commit.
automation.last_run = datetime.datetime.utcnow()
db.session.commit()