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