mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
fix(relays): get rid of custom kind 13314 conditional
This commit is contained in:
parent
3e40e690c5
commit
0f392b2dba
1 changed files with 1 additions and 11 deletions
|
|
@ -14,12 +14,9 @@ import { relayConnectionsGauge, relayEventCounter, relayMessageCounter } from '@
|
|||
import * as pipeline from '@/pipeline.ts';
|
||||
import { RelayError } from '@/RelayError.ts';
|
||||
import { Storages } from '@/storages.ts';
|
||||
import { prometheusParams } from '@/db/KyselyLogger.ts';
|
||||
import { AdminSigner } from '@/signers/AdminSigner.ts';
|
||||
|
||||
/** Limit of initial events returned for a subscription. */
|
||||
const FILTER_LIMIT = 100;
|
||||
const adminPubkey = await new AdminSigner().getPublicKey();
|
||||
|
||||
/** Set up the Websocket connection. */
|
||||
function connectStream(socket: WebSocket) {
|
||||
|
|
@ -55,14 +52,7 @@ function connectStream(socket: WebSocket) {
|
|||
handleReq(msg);
|
||||
return;
|
||||
case 'EVENT':
|
||||
if (msg[1].kind === 13314 && msg[1].pubkey === adminPubkey) {
|
||||
try {
|
||||
const parsed = JSON.parse(msg[1].content);
|
||||
if (parsed.threshold) prometheusParams.threshold = parsed.threshold;
|
||||
} catch (e) {
|
||||
console.debug(`Error parsing kind 13314 ${msg[1].content}: ${e}`);
|
||||
}
|
||||
} else handleEvent(msg);
|
||||
handleEvent(msg);
|
||||
return;
|
||||
case 'CLOSE':
|
||||
handleClose(msg);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue