mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
chore(server): decrease amount of batch updates merging (#4860)
This commit is contained in:
@@ -78,7 +78,7 @@ export class DocManager implements OnModuleInit, OnModuleDestroy {
|
||||
|
||||
protected recoverDoc(...updates: Buffer[]): Promise<Doc> {
|
||||
const doc = new Doc();
|
||||
const chunks = chunk(updates, 100);
|
||||
const chunks = chunk(updates, 10);
|
||||
|
||||
return new Promise(resolve => {
|
||||
const next = () => {
|
||||
@@ -355,8 +355,9 @@ export class DocManager implements OnModuleInit, OnModuleDestroy {
|
||||
protected async autoSquash() {
|
||||
// find the first update and batch process updates with same id
|
||||
const first = await this.db.update.findFirst({
|
||||
orderBy: {
|
||||
createdAt: 'asc',
|
||||
select: {
|
||||
id: true,
|
||||
workspaceId: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user