mirror of
https://iceshrimp.dev/blueb/Chuckya-fe-standalone.git
synced 2026-01-11 13:33:21 -08:00
Merge commit '774e1189d2' into glitch-soc/merge-upstream
This commit is contained in:
commit
4a9cdfb928
19 changed files with 39 additions and 38 deletions
|
|
@ -256,7 +256,7 @@ const startServer = async () => {
|
|||
CHANNEL_NAMES.forEach(( channel ) => {
|
||||
connectedChannels.set({ type: 'websocket', channel }, 0);
|
||||
connectedChannels.set({ type: 'eventsource', channel }, 0);
|
||||
})
|
||||
});
|
||||
|
||||
// Prime the counters so that we don't loose metrics between restarts.
|
||||
// Unfortunately counters don't support the set() API, so instead I'm using
|
||||
|
|
@ -1317,7 +1317,7 @@ const startServer = async () => {
|
|||
log.verbose(request.requestId, 'Subscription error:', err.toString());
|
||||
socket.send(JSON.stringify({ error: err.toString() }));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const removeSubscription = (subscriptions, channelIds, request) => {
|
||||
|
|
@ -1337,7 +1337,7 @@ const startServer = async () => {
|
|||
subscription.stopHeartbeat();
|
||||
|
||||
delete subscriptions[channelIds.join(';')];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {WebSocketSession} session
|
||||
|
|
@ -1357,7 +1357,7 @@ const startServer = async () => {
|
|||
socket.send(JSON.stringify({ error: "Error unsubscribing from channel" }));
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {WebSocketSession} session
|
||||
|
|
@ -1435,7 +1435,7 @@ const startServer = async () => {
|
|||
const subscriptions = Object.keys(session.subscriptions);
|
||||
|
||||
subscriptions.forEach(channelIds => {
|
||||
removeSubscription(session.subscriptions, channelIds.split(';'), req)
|
||||
removeSubscription(session.subscriptions, channelIds.split(';'), req);
|
||||
});
|
||||
|
||||
// Decrement the metrics for connected clients:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue