添加任务到队列
(self)
| 2913 | self._tasks.append(script) |
| 2914 | |
| 2915 | def init_tasks(self): |
| 2916 | """添加任务到队列""" |
| 2917 | with self.lock: |
| 2918 | for idx, task in enumerate(self._tasks): |
| 2919 | next_execution_time = task.first() + idx*3 |
| 2920 | heapq.heappush(self.heap, (next_execution_time, task.get_ident(), task)) |
| 2921 | self._tasks = None |
| 2922 | |
| 2923 | def repetition_check(self, task: _Script) -> bool: |
| 2924 | real_cmd = task.cmd.strip() |