|
@@ -329,13 +329,13 @@ class Script:
|
|
|
if self.state_queue:
|
|
if self.state_queue:
|
|
|
self.state_queue.put({"schedule": self.config.get_schedule_data()})
|
|
self.state_queue.put({"schedule": self.config.get_schedule_data()})
|
|
|
now = datetime.now()
|
|
now = datetime.now()
|
|
|
|
|
+ if not self._try_acquire_queue_token():
|
|
|
|
|
+ del_cached_property(self, "config")
|
|
|
|
|
+ continue
|
|
|
# 任务时间到了返回任务名称
|
|
# 任务时间到了返回任务名称
|
|
|
if task.next_run <= now:
|
|
if task.next_run <= now:
|
|
|
return task.command
|
|
return task.command
|
|
|
# 根据策略执行等待逻辑
|
|
# 根据策略执行等待逻辑
|
|
|
- if not self._try_acquire_queue_token():
|
|
|
|
|
- del_cached_property(self, "config")
|
|
|
|
|
- continue
|
|
|
|
|
if not self._handle_wait_during_idle(task.next_run):
|
|
if not self._handle_wait_during_idle(task.next_run):
|
|
|
# 若等待被打断, 则刷新配置
|
|
# 若等待被打断, 则刷新配置
|
|
|
del_cached_property(self, "config")
|
|
del_cached_property(self, "config")
|
|
@@ -668,10 +668,6 @@ class Script:
|
|
|
del_cached_property(self, 'config')
|
|
del_cached_property(self, 'config')
|
|
|
continue
|
|
continue
|
|
|
|
|
|
|
|
- if not self._try_acquire_queue_token():
|
|
|
|
|
- del_cached_property(self, 'config')
|
|
|
|
|
- continue
|
|
|
|
|
-
|
|
|
|
|
if self._emulator_down:
|
|
if self._emulator_down:
|
|
|
self.device = Device(self.config)
|
|
self.device = Device(self.config)
|
|
|
self._emulator_down = False
|
|
self._emulator_down = False
|