update collaboration

This commit is contained in:
Philipinho
2023-10-21 14:16:52 +01:00
parent 926d5049bd
commit 968b9c3a0f
5 changed files with 15 additions and 11 deletions

View File

@ -30,10 +30,14 @@ export class CollabWsAdapter {
return this.wss;
}
public close() {
this.wss.clients.forEach((client) => {
client.terminate();
});
this.wss.close();
public destroy() {
try {
this.wss.clients.forEach((client) => {
client.terminate();
});
this.wss.close();
} catch (err) {
console.error(err);
}
}
}

View File

@ -22,7 +22,7 @@ export class CollaborationGateway {
this.hocuspocus.handleConnection(client, request);
}
handleDestroy() {
destroy() {
this.hocuspocus.destroy();
}
}

View File

@ -39,7 +39,7 @@ export class CollaborationModule implements OnModuleInit, OnModuleDestroy {
}
onModuleDestroy(): any {
this.collaborationGateway.handleDestroy();
this.collabWsAdapter.close();
this.collaborationGateway.destroy();
this.collabWsAdapter.destroy();
}
}