automate: don't run automation on first sight
This commit is contained in:
parent
e84e77bb28
commit
7624252476
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue