Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions engine/sdks/typescript/runner/src/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
}

#actors: Map<string, ActorInstance> = new Map();
#actorWebSockets: Map<string, Set<WebSocketTunnelAdapter>> = new Map();

Check warning on line 103 in engine/sdks/typescript/runner/src/mod.ts

View workflow job for this annotation

GitHub Actions / quality

lint/correctness/noUnusedPrivateClassMembers

This private class member is defined but never used.

Check warning on line 103 in engine/sdks/typescript/runner/src/mod.ts

View workflow job for this annotation

GitHub Actions / quality

lint/correctness/noUnusedPrivateClassMembers

This private class member is defined but never used.

// WebSocket
#pegboardWebSocket?: WebSocket;
Expand Down Expand Up @@ -449,9 +449,11 @@
}

// MARK: Networking
get pegboardEndpoint() {
return this.#config.pegboardEndpoint || this.#config.endpoint;
}
get pegboardUrl() {
const endpoint = this.#config.pegboardEndpoint || this.#config.endpoint;
const wsEndpoint = endpoint
const wsEndpoint = this.pegboardEndpoint
.replace("http://", "ws://")
.replace("https://", "wss://");

Expand All @@ -472,8 +474,16 @@
const ws = new WS(this.pegboardUrl, protocols) as any as WebSocket;
this.#pegboardWebSocket = ws;

logger()?.info({
msg: "connecting",
endpoint: this.pegboardEndpoint,
namespace: this.#config.namespace,
runnerKey: this.#config.runnerKey,
hasToken: !!this.config.token,
});

ws.addEventListener("open", () => {
logger()?.info({ msg: "Connected" });
logger()?.info({ msg: "connected" });

// Reset reconnect attempt counter on successful connection
this.#reconnectAttempt = 0;
Expand Down
Loading