mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Resolve duplicate script execution for global script. Make paused script fire at_server_reload. Resolve #1911.
This commit is contained in:
parent
ad2e0ce0be
commit
7d8d3216a9
2 changed files with 8 additions and 4 deletions
|
|
@ -163,7 +163,8 @@ class ScriptBase(with_metaclass(TypeclassBase, ScriptDB)):
|
|||
Start task runner.
|
||||
|
||||
"""
|
||||
|
||||
if self.ndb._task:
|
||||
return
|
||||
self.ndb._task = ExtendedLoopingCall(self._step_task)
|
||||
|
||||
if self.db._paused_time:
|
||||
|
|
@ -429,7 +430,8 @@ 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
|
||||
# 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:
|
||||
self.ndb._task = ExtendedLoopingCall(self._step_task)
|
||||
try:
|
||||
|
|
@ -440,7 +442,9 @@ class DefaultScript(ScriptBase):
|
|||
now = not self.db_start_delay
|
||||
start_delay = None
|
||||
callcount = 0
|
||||
self.ndb._task.start(self.db_interval, now=now, start_delay=start_delay, count_start=callcount)
|
||||
self.ndb._task.start(self.db_interval, now=now,
|
||||
start_delay=start_delay,
|
||||
count_start=callcount)
|
||||
return 0
|
||||
|
||||
obj = self.obj
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue