Răsfoiți Sursa

去掉容代码

XQ 4 luni în urmă
părinte
comite
220b781ebf
1 a modificat fișierele cu 3 adăugiri și 7 ștergeri
  1. 3 7
      script.py

+ 3 - 7
script.py

@@ -329,13 +329,13 @@ class Script:
             if self.state_queue:
                 self.state_queue.put({"schedule": self.config.get_schedule_data()})
             now = datetime.now()
+            if not self._try_acquire_queue_token():
+                del_cached_property(self, "config")
+                continue
             # 任务时间到了返回任务名称
             if task.next_run <= now:
                 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):
                 # 若等待被打断, 则刷新配置
                 del_cached_property(self, "config")
@@ -668,10 +668,6 @@ class Script:
                 del_cached_property(self, 'config')
                 continue
 
-            if not self._try_acquire_queue_token():
-                del_cached_property(self, 'config')
-                continue
-
             if self._emulator_down:
                 self.device = Device(self.config)
                 self._emulator_down = False