Skip to content

Commit

Permalink
工具人数据加入缓存
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawnsdaddy committed Sep 27, 2024
1 parent dfe5a30 commit 41f43bb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion arknights_mower/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from pathlib import Path

__version__ = "2024.9.2"
__version__ = "2024.9.4"

if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
__rootdir__ = Path(sys._MEIPASS).joinpath("arknights_mower").resolve()
Expand Down
5 changes: 4 additions & 1 deletion arknights_mower/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,11 @@ def simulate(saved):
base_scheduler.daily_skland = saved["daily_skland"]
base_scheduler.daily_mail = saved["daily_mail"]
base_scheduler.task_count = saved["task_count"]
base_scheduler.op_data.skill_upgrade_supports = saved[
"skill_upgrade_supports"
]
except Exception as ex:
logger.error(ex)
logger.exception(ex)
base_scheduler.tasks = tasks
while True:
try:
Expand Down
3 changes: 2 additions & 1 deletion arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,8 @@ def agent_get_mood(self, skip_dorm=False, force=False):
need_read = set(
v.room
for k, v in self.op_data.operators.items()
if v.need_to_refresh() and v.room in base_room_list
if v.need_to_refresh(0.5 if k in ["歌蕾蒂娅", "见行者"] else 2)
and v.room in base_room_list
)
for room in need_read:
error_count = 0
Expand Down
1 change: 1 addition & 0 deletions arknights_mower/solvers/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def save_wrapper(*args, **kwargs):
"daily_skland": base_scheduler.daily_skland,
"daily_mail": base_scheduler.daily_mail,
"task_count": base_scheduler.task_count,
"skill_upgrade_supports": base_scheduler.op_data.skill_upgrade_supports,
}

# Call the original function
Expand Down
1 change: 0 additions & 1 deletion arknights_mower/utils/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ def not_valid(self):
else:
return False
return (
# 歌蕾蒂娅主班 刷新心情频率提升
self.need_to_refresh(2.5)
or self.current_room != self.room
or self.index != self.current_index
Expand Down
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def get_count():
if len(supports) == 0:
raise Exception("请添加专精工具人")
base_scheduler.op_data.skill_upgrade_supports = supports
logger.error("更新专精工具人完毕")
logger.info("更新专精工具人完毕")
base_scheduler.tasks.append(new_task)
logger.debug(f"成功:{str(new_task)}")
return "添加任务成功!"
Expand Down

0 comments on commit 41f43bb

Please sign in to comment.