mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-25 03:33:33 +01:00
Fix dumping incoming messages
This commit is contained in:
parent
a69c047854
commit
f544c6890c
@ -46,9 +46,9 @@ export async function Message(this: WebSocket, buffer: WS.Data) {
|
||||
if (process.env.WS_DUMP) {
|
||||
const id = this.session_id || "unknown";
|
||||
|
||||
await fs.mkdir(path.join("dump", this.session_id), { recursive: true });
|
||||
await fs.mkdir(path.join("dump", id), { recursive: true });
|
||||
await fs.writeFile(
|
||||
path.join("dump", this.session_id, `${Date.now()}.in.json`),
|
||||
path.join("dump", id, `${Date.now()}.in.json`),
|
||||
JSON.stringify(data, null, 2),
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user