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
@@ -312,7 +312,10 @@ class Handler(Exchange):
|
||||
return
|
||||
receive = self.receiver(path, host)
|
||||
if receive is not None:
|
||||
receive(self.rfile.read(length))
|
||||
try:
|
||||
receive(self.rfile.read(length))
|
||||
finally:
|
||||
self.server.hub.live_state.invalidate()
|
||||
|
||||
def do_PATCH(self) -> None:
|
||||
path = urlsplit(self.path).path
|
||||
@@ -328,6 +331,7 @@ class Handler(Exchange):
|
||||
if length is not None:
|
||||
body = self.rfile.read(length)
|
||||
self.answer(lambda: self.server.hub.view_store.patch(body), HTTPStatus.OK)
|
||||
self.server.hub.live_state.invalidate()
|
||||
|
||||
def index(self) -> None:
|
||||
nonce = secrets.token_urlsafe(18)
|
||||
|
||||
Reference in new issue
Block a user