mirror of
https://github.com/docmost/docmost.git
synced 2026-05-13 02:34:05 +08:00
fd36076ae7
* disconnect real-time collab if user is idle * log yjs document disconnect and unload in dev mode * no longer set editor to read-only mode on collab websocket disconnection * treat delayed collab websocket "connecting" state as disconnected * increase maxDebounce to 45 seconds * add reset handle to useIdle hook
20 lines
559 B
TypeScript
20 lines
559 B
TypeScript
import {
|
|
Extension,
|
|
onDisconnectPayload,
|
|
onLoadDocumentPayload,
|
|
} from '@hocuspocus/server';
|
|
import { Injectable, Logger } from '@nestjs/common';
|
|
|
|
@Injectable()
|
|
export class LoggerExtension implements Extension {
|
|
private readonly logger = new Logger('Collab' + LoggerExtension.name);
|
|
|
|
async onDisconnect(data: onDisconnectPayload) {
|
|
this.logger.debug(`User disconnected from "${data.documentName}".`);
|
|
}
|
|
|
|
async afterUnloadDocument(data: onLoadDocumentPayload) {
|
|
this.logger.debug('Unloaded ' + data.documentName + ' from memory');
|
|
}
|
|
}
|