Repository navigation
Conversation
删除 `TodayWaifu/prefetch.py` 整模块(23:20 预下载循环、状态文件、限速下载)、 `constants.py` 的全部 `PREFETCH_*` 常量、`shared.py` 的预热任务启停钩子, 以及配置项 `DailyWifePrefetchEnabled`、`DailyWifePrefetchImagesPerRole` (含兼容清单条目)与对应测试。 保留「抽签优先已缓存图片」与启动时恢复缓存索引:这两者不产生任何下载, 仅让已落盘的图片优先被抽中;`restore_cached_url_index` 由 `prefetch.py` 挪入 `shared.py`。
|
No actionable comments were generated in the recent review. Walkthrough
Change: Other Merge Risk:
|
|
Note Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
|
Coding Agent task started for unit test generation. |
改动
移除图库图片的零点前预热(提前下载)机制,含其全部配置项:
TodayWaifu/prefetch.py整模块:23:20 预热窗口、限速下载、每日一次状态文件、调度循环TodayWaifu/constants.py中全部PREFETCH_*常量DailyWifePrefetchEnabled(零点前预热图库图片)与DailyWifePrefetchImagesPerRole(每个角色预热图片数),含tests/compatibility_manifest.json对应条目TodayWaifu/shared.py:删除预热任务的启动/关停钩子与任务句柄,钩子改名为_start_gallery_services_on_startup/_stop_gallery_services_on_shutdown(只保留图片投递 worker 启停与缓存索引恢复)tests/test_prefetch.py与tests/test_image_source_switch.py中的预热用例file_cache.py、gallery.py、image_shrink.py、roles.py、senders.py中描述预热的注释文案保留
「抽签优先已缓存图片」(
prefer_cached_urls)与启动时从磁盘恢复缓存索引保留:这两者不下载任何图片,只让已落盘的图片优先被抽中。restore_cached_url_index原在prefetch.py中,本次挪入shared.py。验证
compileall通过,代码与测试中已无prefetch/PREFETCH/ 预热残留引用qgbot/sqlmodel依赖的既有环境错误外全部通过(已用改动前基线对照,错误一致,非本次引入)Summary by CodeRabbit