summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-07-27 00:33:12 +0200
committerRory& <root@rory.gay>2026-07-27 00:33:12 +0200
commit41325f94c24f983f78b2b70e88f18ef9349b259f (patch)
treea1aa933524f8d94c14ae0b492089d7953d6f089c
parentAdd util script to send IPC messages, "fix" ID stuff (diff)
downloadserver-ts-41325f94c24f983f78b2b70e88f18ef9349b259f.tar.xz
Add worker name + nix
-rw-r--r--nix/modules/default/gw-sharding.nix1
-rw-r--r--src/gateway/opcodes/Identify.ts2
2 files changed, 2 insertions, 1 deletions
diff --git a/nix/modules/default/gw-sharding.nix b/nix/modules/default/gw-sharding.nix

index 45f4e1a5..03382678 100644 --- a/nix/modules/default/gw-sharding.nix +++ b/nix/modules/default/gw-sharding.nix
@@ -39,6 +39,7 @@ in # things we set by default... EVENT_TRANSMISSION = "unix"; EVENT_SOCKET_PATH = "/run/spacebar/"; + WORKER_NAME = "sb-gateway-${port}"; } // cfg.extraEnvironment // { diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts
index 08b77b65..e7829ee7 100644 --- a/src/gateway/opcodes/Identify.ts +++ b/src/gateway/opcodes/Identify.ts
@@ -67,7 +67,7 @@ import { check } from "./instanceOf"; export async function onIdentify(this: WebSocket, data: Payload) { const totalSw = Stopwatch.startNew(); const taskSw = Stopwatch.startNew(); - const gatewayShardName = `sb-gateway`; + const gatewayShardName = process.env.WORKER_NAME ?? `sb-gateway`; if (this.user_id) { // we've already identified