mirror of
https://github.com/docmost/docmost.git
synced 2026-05-09 15:53:10 +08:00
unique collab serverId generation
This commit is contained in:
@@ -18,6 +18,8 @@ import {
|
||||
import { WsSocketWrapper } from './extensions/redis-sync/ws-socket-wrapper';
|
||||
import RedisClient from 'ioredis';
|
||||
import { pack, unpack } from 'msgpackr';
|
||||
import { nanoid } from 'nanoid';
|
||||
import * as os from 'node:os';
|
||||
import { CollabWsAdapter } from './adapter/collab-ws.adapter';
|
||||
import {
|
||||
CollaborationHandler,
|
||||
@@ -65,7 +67,7 @@ export class CollaborationGateway {
|
||||
family: this.redisConfig.family,
|
||||
retryStrategy: createRetryStrategy(),
|
||||
}),
|
||||
serverId: `collab-${process.pid}`,
|
||||
serverId: `collab-${os?.hostname()}-${nanoid(10)}`,
|
||||
prefix: 'collab',
|
||||
pack,
|
||||
unpack,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Adapted from https://github.com/ueberdosis/hocuspocus/pull/1008 - MIT
|
||||
// Source https://github.com/ueberdosis/hocuspocus/pull/1008 - MIT
|
||||
import { IncomingMessage } from 'node:http';
|
||||
import {
|
||||
Extension,
|
||||
@@ -12,7 +12,7 @@ import RedisClient from 'ioredis';
|
||||
import { readVarString } from 'lib0/decoding.js';
|
||||
import { WebSocket } from 'ws';
|
||||
import { CollabProxySocket } from './collab-proxy-socket';
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { Logger } from '@nestjs/common';
|
||||
import {
|
||||
BaseWebSocket,
|
||||
Configuration,
|
||||
|
||||
+1
-1
Submodule apps/server/src/ee updated: 88e3d01f81...f858f127b5
Reference in New Issue
Block a user