This repository has been archived on 2026-10-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
snowy-yang
445c16c329
refactor: web/routers/tasks.py 的 _touch_device 收敛到 services 版
为什么:_touch_device 在 services/tasks.py 与 web/routers/tasks.py 各有一份
逐字相同的实现,且两份都活着。同一份「更新设备心跳时间」的逻辑有两处副本,
改一处忘另一处就会出现行为分叉。
改法:删掉 web 层本地副本(16 行),改为调用 services.tasks._touch_device
(两处调用点),并补 import asyncio 以包裹 to_thread。
说明:上一轮报告里提到的「6 组分叉实现」实测需逐组降级——success()/error()
分属不同层(一个是 tuple 返回、一个是 JSONResponse),iter_content 是两个垫片
的适配器,都**不该**合并;只有 _touch_device 是真·逐字重复,故只收敛这一组。
2026-09-26 18:54:04 +08:00
..
2026-09-26 18:54:04 +08:00
2026-09-26 12:37:48 +08:00
2026-09-26 18:53:40 +08:00
2026-09-26 13:54:23 +08:00
2026-09-26 12:37:48 +08:00
2026-09-26 12:37:48 +08:00
2026-09-26 12:37:48 +08:00
2026-09-26 11:52:06 +08:00
2026-09-26 12:37:48 +08:00
2026-09-26 18:53:59 +08:00
2026-09-26 10:20:46 +08:00
2026-09-26 12:37:48 +08:00
2026-09-26 12:37:48 +08:00
2026-09-26 14:48:05 +08:00