From 76242524767defef17f9b3344fcccc0a0d49fe47 Mon Sep 17 00:00:00 2001 From: Iain Learmonth Date: Sat, 14 May 2022 12:05:06 +0100 Subject: [PATCH] automate: don't run automation on first sight --- app/cli/automate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/cli/automate.py b/app/cli/automate.py index 34a5925..3691372 100644 --- a/app/cli/automate.py +++ b/app/cli/automate.py @@ -68,6 +68,7 @@ def run_job(job: BaseAutomation, *, force: bool = False, ignore_schedule: bool = automation.added = datetime.datetime.utcnow() automation.updated = automation.added db.session.add(automation) + db.session.commit() else: if automation.state == AutomationState.RUNNING and not force: logging.warning("Not running an already running automation") @@ -77,7 +78,6 @@ def run_job(job: BaseAutomation, *, force: bool = False, ignore_schedule: bool = logging.warning("Not time to run this job yet") return if not automation.enabled and not force: - db.session.rollback() logging.warning(f"job {job.short_name} is disabled and --force not specified") return automation.state = AutomationState.RUNNING