refactor: use correct Stickynotes, and not legacy Debug

This commit is contained in:
P. Reis 2024-09-23 15:33:14 -03:00
parent 1a1adc1654
commit 60ebff45d5

View file

@ -1,4 +1,4 @@
import Debug from '@soapbox/stickynotes/debug'; import { Stickynotes } from '@soapbox/stickynotes';
import TTLCache from '@isaacs/ttlcache'; import TTLCache from '@isaacs/ttlcache';
import { import {
NostrClientCLOSE, NostrClientCLOSE,
@ -30,7 +30,7 @@ const limiter = new TTLCache<string, number>();
/** Connections for metrics purposes. */ /** Connections for metrics purposes. */
const connections = new Set<WebSocket>(); const connections = new Set<WebSocket>();
const debug = Debug('ditto:relay'); const console = new Stickynotes('ditto:relay');
/** Set up the Websocket connection. */ /** Set up the Websocket connection. */
function connectStream(socket: WebSocket, ip: string | undefined) { function connectStream(socket: WebSocket, ip: string | undefined) {
@ -144,7 +144,7 @@ function connectStream(socket: WebSocket, ip: string | undefined) {
send(['OK', event.id, false, e.message]); send(['OK', event.id, false, e.message]);
} else { } else {
send(['OK', event.id, false, 'error: something went wrong']); send(['OK', event.id, false, 'error: something went wrong']);
debug(e); console.error(e);
} }
} }
} }