perf(hub): cache the names directory, share state builds, retry stations
Concurrent /api/state polls share one build through LiveState for a short TTL, and every POST and PATCH invalidates it, so a write is never followed by a stale view. The names directory is cached, the first transcript scan reads outside the hub lock, the graph timeline starts at the window begin, and unresolved radio stations are retried on a daemon thread every RETRY_SECONDS instead of failing until restart. 🎯 Fix: 85 % 💥 Break: 8 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 78 🚦 Gate: ⛔ fix 85 % < 90, break 8 % > 5 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6c63c364bd
commit
96d4d2933c
18 files changed
+299
-32
No files matched your search
@@ -77,6 +77,7 @@ class HubCase(unittest.TestCase):
|
||||
engines=self.engines,
|
||||
approvers=self.approvers,
|
||||
redirects=self.redirects(),
|
||||
live_ttl=self.live_ttl(),
|
||||
)
|
||||
self.httpd = httpd
|
||||
self.origin = signing.origin_of(self.port)
|
||||
@@ -90,6 +91,13 @@ class HubCase(unittest.TestCase):
|
||||
def redirects(self) -> Redirects:
|
||||
return offline_redirects()
|
||||
|
||||
def live_ttl(self) -> float:
|
||||
"""Returns:
|
||||
0, so a test that writes council files directly reads them in the
|
||||
next state; a case testing the live cache overrides it.
|
||||
"""
|
||||
return 0.0
|
||||
|
||||
def call(self, method: str, path: str, body: bytes | None, headers: dict[str, str]) -> tuple[int, dict, bytes]:
|
||||
connection = http.client.HTTPConnection("127.0.0.1", self.port, timeout=30)
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user