Resolved issue113, avoiding a loophole in which the protection about @reloading a timed script could be circumvented.
This commit is contained in:
parent
3f703efc2d
commit
7eaf3d221c
3 changed files with 4 additions and 4 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue