Merge pull request #2178 from luyijun/myfix

Fix a bug that script whose db_interval is 0 will be run when call its start method twice.
This commit is contained in:
Griatch 2020-09-03 08:39:21 +02:00 committed by GitHub
commit cfc1a0bca0

View file

@ -437,7 +437,7 @@ class DefaultScript(ScriptBase):
if self.is_active and not force_restart:
# The script is already running, but make sure we have a _task if
# this is after a cache flush
if not self.ndb._task and self.db_interval >= 0:
if not self.ndb._task and self.db_interval > 0:
self.ndb._task = ExtendedLoopingCall(self._step_task)
try:
start_delay, callcount = SCRIPT_FLUSH_TIMERS[self.id]