fix: support multiple keys per action and harden runtime/parsing
This commit is contained in:
@@ -6,11 +6,20 @@ import { type LlamaSwapConfig } from "./util";
|
||||
class Runtime {
|
||||
readonly tracker = new InflightTracker();
|
||||
offline = true;
|
||||
private cfg?: LlamaSwapConfig;
|
||||
private feed?: EventFeed;
|
||||
private poller?: MetricsPoller;
|
||||
private listeners = new Set<() => void>();
|
||||
|
||||
ensureConnections(cfg: LlamaSwapConfig): void {
|
||||
const changed = !this.cfg || this.cfg.baseUrl !== cfg.baseUrl || this.cfg.apiKey !== cfg.apiKey;
|
||||
if (changed) {
|
||||
this.feed?.stop();
|
||||
this.poller?.stop();
|
||||
this.feed = undefined;
|
||||
this.poller = undefined;
|
||||
this.cfg = cfg;
|
||||
}
|
||||
if (!this.feed) {
|
||||
this.feed = new EventFeed(cfg, (ev) => {
|
||||
this.tracker.apply(ev);
|
||||
|
||||
Reference in New Issue
Block a user