mirror of
https://github.com/docmost/docmost.git
synced 2025-11-13 08:32:38 +10:00
Compare commits
2 Commits
7491224d0f
...
exception
| Author | SHA1 | Date | |
|---|---|---|---|
| 3e69924448 | |||
| 3b5fee05c1 |
@ -1,4 +1,4 @@
|
|||||||
import { Module, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
import { Logger, Module, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
||||||
import { AuthenticationExtension } from './extensions/authentication.extension';
|
import { AuthenticationExtension } from './extensions/authentication.extension';
|
||||||
import { PersistenceExtension } from './extensions/persistence.extension';
|
import { PersistenceExtension } from './extensions/persistence.extension';
|
||||||
import { CollaborationGateway } from './collaboration.gateway';
|
import { CollaborationGateway } from './collaboration.gateway';
|
||||||
@ -22,6 +22,7 @@ import { LoggerExtension } from './extensions/logger.extension';
|
|||||||
imports: [TokenModule],
|
imports: [TokenModule],
|
||||||
})
|
})
|
||||||
export class CollaborationModule implements OnModuleInit, OnModuleDestroy {
|
export class CollaborationModule implements OnModuleInit, OnModuleDestroy {
|
||||||
|
private readonly logger = new Logger(CollaborationModule.name);
|
||||||
private collabWsAdapter: CollabWsAdapter;
|
private collabWsAdapter: CollabWsAdapter;
|
||||||
private path = '/collab';
|
private path = '/collab';
|
||||||
|
|
||||||
@ -38,7 +39,15 @@ export class CollaborationModule implements OnModuleInit, OnModuleDestroy {
|
|||||||
|
|
||||||
wss.on('connection', (client: WebSocket, request: IncomingMessage) => {
|
wss.on('connection', (client: WebSocket, request: IncomingMessage) => {
|
||||||
this.collaborationGateway.handleConnection(client, request);
|
this.collaborationGateway.handleConnection(client, request);
|
||||||
|
|
||||||
|
client.on('error', (error) => {
|
||||||
|
this.logger.error('WebSocket client error:', error);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
wss.on('error', (error) =>
|
||||||
|
this.logger.log('WebSocket server error:', error),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async onModuleDestroy(): Promise<void> {
|
async onModuleDestroy(): Promise<void> {
|
||||||
|
|||||||
@ -130,7 +130,7 @@ export class PersistenceExtension implements Extension {
|
|||||||
);
|
);
|
||||||
this.contributors.delete(documentName);
|
this.contributors.delete(documentName);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.logger.log('Contributors error:' + err?.['message']);
|
this.logger.debug('Contributors error:' + err?.['message']);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.pageRepo.updatePage(
|
await this.pageRepo.updatePage(
|
||||||
|
|||||||
@ -4,12 +4,7 @@ import {
|
|||||||
FastifyAdapter,
|
FastifyAdapter,
|
||||||
NestFastifyApplication,
|
NestFastifyApplication,
|
||||||
} from '@nestjs/platform-fastify';
|
} from '@nestjs/platform-fastify';
|
||||||
import {
|
import { Logger, NotFoundException, ValidationPipe } from '@nestjs/common';
|
||||||
Logger,
|
|
||||||
NotFoundException,
|
|
||||||
RequestMethod,
|
|
||||||
ValidationPipe,
|
|
||||||
} from '@nestjs/common';
|
|
||||||
import { TransformHttpResponseInterceptor } from './common/interceptors/http-response.interceptor';
|
import { TransformHttpResponseInterceptor } from './common/interceptors/http-response.interceptor';
|
||||||
import { WsRedisIoAdapter } from './ws/adapter/ws-redis.adapter';
|
import { WsRedisIoAdapter } from './ws/adapter/ws-redis.adapter';
|
||||||
import { InternalLogFilter } from './common/logger/internal-log-filter';
|
import { InternalLogFilter } from './common/logger/internal-log-filter';
|
||||||
@ -92,6 +87,14 @@ async function bootstrap() {
|
|||||||
|
|
||||||
const logger = new Logger('NestApplication');
|
const logger = new Logger('NestApplication');
|
||||||
|
|
||||||
|
process.on('unhandledRejection', (reason, promise) => {
|
||||||
|
logger.error(`UnhandledRejection: ${promise}, reason: ${reason}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
process.on('uncaughtException', (error) => {
|
||||||
|
logger.error('UncaughtException:', error);
|
||||||
|
});
|
||||||
|
|
||||||
const port = process.env.PORT || 3000;
|
const port = process.env.PORT || 3000;
|
||||||
await app.listen(port, '0.0.0.0', () => {
|
await app.listen(port, '0.0.0.0', () => {
|
||||||
logger.log(
|
logger.log(
|
||||||
|
|||||||
Reference in New Issue
Block a user