mirror of
https://github.com/Cameri/nostream.git
synced 2025-10-01 18:00:24 +02:00
chore: reduce heartbeat logging
This commit is contained in:
@@ -33,7 +33,7 @@ export class WebServerAdapter extends EventEmitter implements IWebServerAdapter
|
||||
}
|
||||
|
||||
private onRequest(request: IncomingMessage, response: ServerResponse) {
|
||||
debug('request received: %o', request)
|
||||
debug('request received: %O', request.rawHeaders)
|
||||
if (request.method === 'GET' && request.headers['accept'] === 'application/nostr+json') {
|
||||
const {
|
||||
info: { name, description, pubkey, contact },
|
||||
@@ -56,7 +56,6 @@ export class WebServerAdapter extends EventEmitter implements IWebServerAdapter
|
||||
response.setHeader('content-type', 'application/text')
|
||||
response.end('Please use a Nostr client to connect.')
|
||||
}
|
||||
debug('send response: %o', response)
|
||||
}
|
||||
|
||||
private onError(error: Error, socket: Duplex) {
|
||||
|
@@ -17,6 +17,7 @@ import { isEventMatchingFilter } from '../utils/event'
|
||||
import { messageSchema } from '../schemas/message-schema'
|
||||
|
||||
const debug = createLogger('web-socket-adapter')
|
||||
const debugHeartbeat = debug.extend('heartbeat')
|
||||
|
||||
export class WebSocketAdapter extends EventEmitter implements IWebSocketAdapter {
|
||||
public clientId: string
|
||||
@@ -103,7 +104,7 @@ export class WebSocketAdapter extends EventEmitter implements IWebSocketAdapter
|
||||
|
||||
this.alive = false
|
||||
this.client.ping()
|
||||
debug('client %s ping', this.clientId)
|
||||
debugHeartbeat('client %s ping', this.clientId)
|
||||
}
|
||||
|
||||
public getSubscriptions(): Map<string, SubscriptionFilter[]> {
|
||||
@@ -145,7 +146,7 @@ export class WebSocketAdapter extends EventEmitter implements IWebSocketAdapter
|
||||
}
|
||||
|
||||
private onClientPong() {
|
||||
debug('client %s pong', this.clientId)
|
||||
debugHeartbeat('client %s pong', this.clientId)
|
||||
this.alive = true
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user