Skip to content

Commit

Permalink
尝试修复不触发插拔检测的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Sep 30, 2023
1 parent 791dd11 commit cdef46d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -1953,16 +1953,16 @@ def agent_arrange(self, plan: tp.BasePlan, get_time=False):
for current_idx, _name in enumerate(plan[room]):
if _name == 'Current':
plan[room][current_idx] = self.op_data.get_current_room(room, True)[current_idx]
if room in self.op_data.run_order_rooms and len(
new_plan) == 0 and self.task.type != TaskTypes.RUN_ORDER:
if plan[room] != self.op_data.get_current_room(room):
logger.debug("检测到插拔房间人员变动!")
run_order_task = find_next_task(self.tasks, datetime.now() + timedelta(minutes=5),
task_type=TaskTypes.RUN_ORDER,
meta_data=room, compare_type=">")
if run_order_task is not None:
logger.info("移除超过5分钟的跑单任务以刷新时间")
self.tasks.remove(run_order_task)
if room in self.op_data.run_order_rooms and len(
new_plan) == 0 and self.task.type != TaskTypes.RUN_ORDER:
if plan[room] != self.op_data.get_current_room(room):
logger.debug("检测到插拔房间人员变动!")
run_order_task = find_next_task(self.tasks, datetime.now() + timedelta(minutes=5),
task_type=TaskTypes.RUN_ORDER,
meta_data=room, compare_type=">")
if run_order_task is not None:
logger.info("移除超过5分钟的跑单任务以刷新时间")
self.tasks.remove(run_order_task)
checked = True
current_room = self.op_data.get_current_room(room, True)
same = len(plan[room]) == len(current_room)
Expand Down

0 comments on commit cdef46d

Please sign in to comment.