[feat] Script refactor; decouple timer component from script lifetime. Resolve #1715

This commit is contained in:
Griatch 2021-03-07 10:34:01 +01:00
parent cd579fb649
commit b5195a6e96
29 changed files with 1136 additions and 1266 deletions

View file

@ -101,7 +101,7 @@ class ScriptDB(TypedObject):
# how often to run Script (secs). -1 means there is no timer
db_interval = models.IntegerField(
"interval", default=-1, help_text="how often to repeat script, in seconds. -1 means off."
"interval", default=-1, help_text="how often to repeat script, in seconds. <= 0 means off."
)
# start script right away or wait interval seconds first
db_start_delay = models.BooleanField(
@ -110,7 +110,7 @@ class ScriptDB(TypedObject):
# how many times this script is to be repeated, if interval!=0.
db_repeats = models.IntegerField("number of repeats", default=0, help_text="0 means off.")
# defines if this script should survive a reboot or not
db_persistent = models.BooleanField("survive server reboot", default=False)
db_persistent = models.BooleanField("survive server reboot", default=True)
# defines if this script has already been started in this session
db_is_active = models.BooleanField("script active", default=False)