mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 05:47:09 +08:00
perf(server): avoid auto select blob data when upsert (#4891)
This commit is contained in:
@@ -201,6 +201,9 @@ export class DocManager implements OnModuleInit, OnModuleDestroy {
|
|||||||
defer(async () => {
|
defer(async () => {
|
||||||
const seq = await this.getUpdateSeq(workspaceId, guid);
|
const seq = await this.getUpdateSeq(workspaceId, guid);
|
||||||
await this.db.update.create({
|
await this.db.update.create({
|
||||||
|
select: {
|
||||||
|
seq: true,
|
||||||
|
},
|
||||||
data: {
|
data: {
|
||||||
workspaceId,
|
workspaceId,
|
||||||
id: guid,
|
id: guid,
|
||||||
@@ -388,10 +391,13 @@ export class DocManager implements OnModuleInit, OnModuleDestroy {
|
|||||||
const state = Buffer.from(encodeStateVector(doc));
|
const state = Buffer.from(encodeStateVector(doc));
|
||||||
|
|
||||||
if (isEmptyBuffer(blob)) {
|
if (isEmptyBuffer(blob)) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.db.snapshot.upsert({
|
await this.db.snapshot.upsert({
|
||||||
|
select: {
|
||||||
|
seq: true,
|
||||||
|
},
|
||||||
where: {
|
where: {
|
||||||
id_workspaceId: {
|
id_workspaceId: {
|
||||||
id: guid,
|
id: guid,
|
||||||
|
|||||||
Reference in New Issue
Block a user