| | |
| | | |
| | | def shutdown_all(self) -> None: |
| | | """清理所有线程""" |
| | | with self.lock: |
| | | for camera_id, thread in list(self.threads.items()): |
| | | if thread.is_alive(): |
| | | thread.join(timeout=1) |
| | | del self.threads[camera_id] |
| | | for camera_id, thread in list(self.threads.items()): |
| | | if thread.is_alive(): |
| | | thread.join(timeout=1) |
| | | del self.threads[camera_id] |
| | | |
| | | |
| | | #获取任务 |
| | | def getTaskconf(self,isupdate): |
| | |
| | | thread = pool.threads.get(camera.get("camera_id")) |
| | | if not thread: |
| | | logging.info(f"开始创建{camera.get('camera_id')}线程") |
| | | pool.safe_start(pool.workerWarning, camera.get('camera_id')) |
| | | pool.safe_start(pool.worker, camera.get('camera_id')) |
| | | logging.info(f"{camera.get('camera_id')}线程创建完毕") |
| | | |