feat: Windows v1.1.1 — 修复与改进(DSH 工作区归档)
This commit is contained in:
1 parent
4a5d676c7b
commit
e6880efdc6
21 files changed
+807
-106
No files matched your search
@@ -558,6 +558,9 @@ class RealLocationProvider:
|
||||
self._last_location = (lat, lon)
|
||||
self._send_count += 1
|
||||
self._last_send_mono = time.monotonic()
|
||||
# 幂等兜底:会话建立时会启动保活,但 clear_location 之后、或任务曾异常退出时
|
||||
# 需要重新拉起 —— 保证「设了点就一定有保活」。
|
||||
self._start_keepalive()
|
||||
if self._send_count == 1 or self._send_count % 25 == 0:
|
||||
self._log("debug", f"已下发 lat={lat:.6f}, lon={lon:.6f}(第 {self._send_count} 次)")
|
||||
|
||||
@@ -627,7 +630,9 @@ class RealLocationProvider:
|
||||
raise _wrap("清除虚拟定位", exc) from exc
|
||||
self._last_location = None
|
||||
self._last_send_mono = 0.0
|
||||
self._stop_keepalive()
|
||||
# 注意:**不要**在这里 _stop_keepalive()。保活循环本来就会在
|
||||
# _last_location is None 时空转;一旦停掉,之后再 set_location 就永远没有保活了
|
||||
# (这是审查发现的真实 bug:先 stop 再设点,等 30s 也不会有保活重发)。
|
||||
self._log("info", "已清除虚拟定位,设备恢复真实定位")
|
||||
|
||||
async def close(self) -> None:
|
||||
|
||||
Reference in new issue
Block a user