mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-27 19:12:05 -04:00
Log
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
CLIENT_MESSAGE_SCHEMA,
|
||||
} from 'common/api/websockets'
|
||||
import {IS_LOCAL} from "common/envs/constants";
|
||||
import {getWebsocketUrl} from "common/api/utils";
|
||||
|
||||
const SWITCHBOARD = new Switchboard()
|
||||
|
||||
@@ -127,7 +128,7 @@ export function listen(server: HttpServer, path: string) {
|
||||
const wss = new WebSocketServer({ server, path })
|
||||
let deadConnectionCleaner: NodeJS.Timeout | undefined
|
||||
wss.on('listening', () => {
|
||||
log.info(`Web socket server listening on ${path}.`)
|
||||
log.info(`Web socket server listening on ${path}. ${getWebsocketUrl()}`)
|
||||
deadConnectionCleaner = setInterval(function ping() {
|
||||
const now = Date.now()
|
||||
for (const ws of wss.clients) {
|
||||
|
||||
@@ -15,12 +15,14 @@ import { PrivateMessageChannel } from 'common/supabase/private-messages'
|
||||
import { useAPIGetter } from 'web/hooks/use-api-getter'
|
||||
import { useApiSubscription } from 'web/hooks/use-api-subscription'
|
||||
import { usePersistentInMemoryState } from 'web/hooks/use-persistent-in-memory-state'
|
||||
import {getWebsocketUrl} from "common/api/utils";
|
||||
|
||||
export function usePrivateMessages(
|
||||
channelId: number,
|
||||
limit: number,
|
||||
userId: string
|
||||
) {
|
||||
console.log('getWebsocketUrl', getWebsocketUrl())
|
||||
const [messages, setMessages] = usePersistentLocalState<
|
||||
PrivateChatMessage[] | undefined
|
||||
>(undefined, `private-messages-${channelId}-${limit}-v1`)
|
||||
|
||||
Reference in New Issue
Block a user