mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 12:36:24 +08:00
fix(server): doc squash timeout (#13939)
This commit is contained in:
@@ -79,11 +79,15 @@ export abstract class DocStorageAdapter extends Connection {
|
|||||||
const updates = await this.getDocUpdates(spaceId, docId);
|
const updates = await this.getDocUpdates(spaceId, docId);
|
||||||
|
|
||||||
if (updates.length) {
|
if (updates.length) {
|
||||||
|
const docUpdate = await this.squash(
|
||||||
|
snapshot ? [snapshot, ...updates] : updates
|
||||||
|
);
|
||||||
return await this.squashUpdatesToSnapshot(
|
return await this.squashUpdatesToSnapshot(
|
||||||
spaceId,
|
spaceId,
|
||||||
docId,
|
docId,
|
||||||
updates,
|
updates,
|
||||||
snapshot
|
snapshot,
|
||||||
|
docUpdate
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,15 +99,14 @@ export abstract class DocStorageAdapter extends Connection {
|
|||||||
spaceId: string,
|
spaceId: string,
|
||||||
docId: string,
|
docId: string,
|
||||||
updates: DocUpdate[],
|
updates: DocUpdate[],
|
||||||
snapshot: DocRecord | null
|
snapshot: DocRecord | null,
|
||||||
|
finalUpdate: DocUpdate
|
||||||
) {
|
) {
|
||||||
this.logger.log(
|
this.logger.log(
|
||||||
`Squashing updates, spaceId: ${spaceId}, docId: ${docId}, updates: ${updates.length}`
|
`Squashing updates, spaceId: ${spaceId}, docId: ${docId}, updates: ${updates.length}`
|
||||||
);
|
);
|
||||||
const { timestamp, bin, editor } = await this.squash(
|
|
||||||
snapshot ? [snapshot, ...updates] : updates
|
|
||||||
);
|
|
||||||
|
|
||||||
|
const { bin, timestamp, editor } = finalUpdate;
|
||||||
const newSnapshot: DocRecord = {
|
const newSnapshot: DocRecord = {
|
||||||
spaceId,
|
spaceId,
|
||||||
docId,
|
docId,
|
||||||
|
|||||||
Reference in New Issue
Block a user