feat: add manual disk discovery and weekly capacity cache

This commit is contained in:
way
2026-10-15 23:30:06 +08:00
parent 174ac747c5
commit 747503d86d
13 changed files with 400 additions and 12 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ from storage_cache import StorageCache
class StorageTests(unittest.TestCase):
def test_daily_reads_and_restart_cache(self):
def test_weekly_reads_and_restart_cache(self):
with tempfile.TemporaryDirectory() as directory:
now=[1000];reads=[]
def reader(path):
@@ -18,7 +18,7 @@ class StorageTests(unittest.TestCase):
self.assertEqual(len(reads),1)
restored=StorageCache(p,reader,lambda:now[0]);restored.sample()
self.assertEqual(len(reads),1)
now[0]=87400;restored.sample()
now[0]=605800;restored.sample()
self.assertEqual(len(reads),2)
def test_failure_does_not_fabricate_zero_or_retry_each_second(self):