From 1a1adc1654f31da5bc9347c26bfb21e9de599600 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Mon, 23 Sep 2024 14:47:17 -0300 Subject: [PATCH] feat: add ditto:relay in /relay - sticky notes --- src/controllers/nostr/relay.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/nostr/relay.ts b/src/controllers/nostr/relay.ts index 3fd6b29a..0cdd8b3a 100644 --- a/src/controllers/nostr/relay.ts +++ b/src/controllers/nostr/relay.ts @@ -1,3 +1,4 @@ +import Debug from '@soapbox/stickynotes/debug'; import TTLCache from '@isaacs/ttlcache'; import { NostrClientCLOSE, @@ -29,6 +30,8 @@ const limiter = new TTLCache(); /** Connections for metrics purposes. */ const connections = new Set(); +const debug = Debug('ditto:relay'); + /** Set up the Websocket connection. */ function connectStream(socket: WebSocket, ip: string | undefined) { const controllers = new Map(); @@ -141,7 +144,7 @@ function connectStream(socket: WebSocket, ip: string | undefined) { send(['OK', event.id, false, e.message]); } else { send(['OK', event.id, false, 'error: something went wrong']); - console.error(e); + debug(e); } } }