diff --git a/src/scripts/models.py b/src/scripts/models.py index 3ea32c3c03..5c99c76aa7 100644 --- a/src/scripts/models.py +++ b/src/scripts/models.py @@ -92,8 +92,8 @@ class ScriptDB(TypedObject): db_desc = models.CharField(max_length=255, blank=True) # A reference to the database object affected by this Script, if any. db_obj = models.ForeignKey(ObjectDB, null=True, blank=True) - # how often to run Script (secs). 0 means there is no timer - db_interval = models.IntegerField(default=0) + # how often to run Script (secs). -1 means there is no timer + db_interval = models.IntegerField(default=-1) # start script right away or wait interval seconds first db_start_delay = models.BooleanField(default=False) # how many times this script is to be repeated, if interval!=0. diff --git a/src/scripts/scripts.py b/src/scripts/scripts.py index 5de93a2e55..6e54f34f52 100644 --- a/src/scripts/scripts.py +++ b/src/scripts/scripts.py @@ -34,7 +34,7 @@ class ScriptClass(TypeClass): def _start_task(self): "start the task runner." - if self.interval: + if self.interval > 0: #print "Starting task runner" start_now = not self.start_delay self.ndb.twisted_task = task.LoopingCall(self._step_task) diff --git a/src/utils/reloads.py b/src/utils/reloads.py index 72f3be31aa..d7d7e05239 100644 --- a/src/utils/reloads.py +++ b/src/utils/reloads.py @@ -39,7 +39,7 @@ def reload_modules(): # these. unsafe_modules = [] for scriptobj in ScriptDB.objects.get_all_scripts(): - if scriptobj.interval and scriptobj.typeclass_path: + if (scriptobj.interval > -1) and scriptobj.typeclass_path: unsafe_modules.append(scriptobj.typeclass_path) unsafe_modules = list(set(unsafe_modules))