Skip to content

Commit 5d31632

Browse files
committed
chore(runner): improve runner connection logs
1 parent 691501d commit 5d31632

File tree

1 file changed

+13
-3
lines changed
  • engine/sdks/typescript/runner/src

1 file changed

+13
-3
lines changed

engine/sdks/typescript/runner/src/mod.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,11 @@ export class Runner {
449449
}
450450

451451
// MARK: Networking
452+
get pegboardEndpoint() {
453+
return this.#config.pegboardEndpoint || this.#config.endpoint;
454+
}
452455
get pegboardUrl() {
453-
const endpoint = this.#config.pegboardEndpoint || this.#config.endpoint;
454-
const wsEndpoint = endpoint
456+
const wsEndpoint = this.pegboardEndpoint
455457
.replace("http://", "ws://")
456458
.replace("https://", "wss://");
457459

@@ -472,8 +474,16 @@ export class Runner {
472474
const ws = new WS(this.pegboardUrl, protocols) as any as WebSocket;
473475
this.#pegboardWebSocket = ws;
474476

477+
logger()?.info({
478+
msg: "connecting",
479+
endpoint: this.pegboardEndpoint,
480+
namespace: this.#config.namespace,
481+
runnerKey: this.#config.runnerKey,
482+
hasToken: !!this.config.token,
483+
});
484+
475485
ws.addEventListener("open", () => {
476-
logger()?.info({ msg: "Connected" });
486+
logger()?.info({ msg: "connected" });
477487

478488
// Reset reconnect attempt counter on successful connection
479489
this.#reconnectAttempt = 0;

0 commit comments

Comments
 (0)