Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

fix(diagnostics): 首次挂载探测不依赖时钟起点

longmeidao3983b2dad2a5
diff --git a/src/peach/mount_reachability.py b/src/peach/mount_reachability.py
index aed93b33f..baaedd64e 100644
--- a/src/peach/mount_reachability.py
+++ b/src/peach/mount_reachability.py
@@ -37,7 +37,7 @@ class MountRoot:
class _Probe:
state: str = "checking"
checked_at: float | None = None
- due: float = 0.0
+ due: float = float("-inf")
started: float = 0.0
pending: Future | None = None
diff --git a/tests/test_platform.py b/tests/test_platform.py
index 94b4a915c..d7c1d087f 100644
--- a/tests/test_platform.py
+++ b/tests/test_platform.py
@@ -322,6 +322,11 @@ class MountReachabilityTests(unittest.TestCase):
self.wait_state("ok")
self.assertEqual(self.monitor.summary()["warnings"], [])
+ def test_first_probe_does_not_depend_on_the_clock_origin(self):
+ self.now = -10000
+ self.wait_state("ok")
+ self.assertEqual(len(self.calls), 1)
+
def test_pending_probe_is_unknown_and_timeout_keeps_one_worker(self):
entered, release = threading.Event(), threading.Event()
self.addCleanup(release.set)