mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 14:43:06 +08:00
Compare commits
2 Commits
a11y-1
...
fix/server
| Author | SHA1 | Date | |
|---|---|---|---|
| 207c119792 | |||
| 4683a85a8b |
@@ -79,6 +79,8 @@ export class RedisSyncExtension<TCE extends CustomEvents> implements Extension {
|
|||||||
this.customEvents = (customEvents as any) ?? ({} as any as CustomEvents);
|
this.customEvents = (customEvents as any) ?? ({} as any as CustomEvents);
|
||||||
this.sub.subscribe(this.msgChannel, `${this.msgChannel}:${this.serverId}`);
|
this.sub.subscribe(this.msgChannel, `${this.msgChannel}:${this.serverId}`);
|
||||||
this.sub.on('messageBuffer', this.handleRedisMessage);
|
this.sub.on('messageBuffer', this.handleRedisMessage);
|
||||||
|
this.pub.on('error', () => {});
|
||||||
|
this.sub.on('error', () => {});
|
||||||
}
|
}
|
||||||
private getKey(documentName: string) {
|
private getKey(documentName: string) {
|
||||||
return `${this.lockPrefix}:${documentName}`;
|
return `${this.lockPrefix}:${documentName}`;
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ async function bootstrap() {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
bufferLogs: true,
|
logger: false,
|
||||||
|
bufferLogs: false,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,11 @@ async function bootstrap() {
|
|||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
rawBody: true,
|
rawBody: true,
|
||||||
bufferLogs: true,
|
// disable Nest logger so pino handles all logs
|
||||||
|
// bufferLogs must be false else pino will fail
|
||||||
|
// to log OnApplicationBootstrap logs
|
||||||
|
logger: false,
|
||||||
|
bufferLogs: false,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -101,7 +105,9 @@ async function bootstrap() {
|
|||||||
|
|
||||||
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(`Listening on http://127.0.0.1:${port} / ${process.env.APP_URL}`);
|
logger.log(
|
||||||
|
`Listening on http://127.0.0.1:${port} / ${process.env.APP_URL}`,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ export class WsRedisIoAdapter extends IoAdapter {
|
|||||||
const pubClient = new Redis(process.env.REDIS_URL, options);
|
const pubClient = new Redis(process.env.REDIS_URL, options);
|
||||||
const subClient = new Redis(process.env.REDIS_URL, options);
|
const subClient = new Redis(process.env.REDIS_URL, options);
|
||||||
|
|
||||||
|
pubClient.on('error', (err) => () => {});
|
||||||
|
subClient.on('error', (err) => () => {});
|
||||||
|
|
||||||
this.adapterConstructor = createAdapter(pubClient, subClient);
|
this.adapterConstructor = createAdapter(pubClient, subClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user