fix: refcount StatsCache keys, keep registrations across config change, and tidy GPU/usage render paths
This commit is contained in:
+2
-5
@@ -12,7 +12,6 @@ class Runtime {
|
||||
private feed?: EventFeed;
|
||||
private poller?: MetricsPoller;
|
||||
private statsCache?: StatsCache;
|
||||
private statsUnsub?: () => void;
|
||||
private listeners = new Set<() => void>();
|
||||
|
||||
ensureConnections(cfg: LlamaSwapConfig): void {
|
||||
@@ -22,9 +21,7 @@ class Runtime {
|
||||
this.poller?.stop();
|
||||
this.feed = undefined;
|
||||
this.poller = undefined;
|
||||
this.statsUnsub?.();
|
||||
this.statsCache = undefined;
|
||||
this.statsUnsub = undefined;
|
||||
this.statsCache?.setConfig(cfg);
|
||||
this.cfg = cfg;
|
||||
}
|
||||
if (!this.feed) {
|
||||
@@ -46,7 +43,7 @@ class Runtime {
|
||||
}
|
||||
if (!this.statsCache) {
|
||||
this.statsCache = new StatsCache(cfg);
|
||||
this.statsUnsub = this.statsCache.onChange(() => this.emit());
|
||||
this.statsCache.onChange(() => this.emit());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user