fix: Minor collab adjusts
This commit is contained in:
@@ -50,7 +50,8 @@ export default class Tracing {
|
||||
|
||||
Metrics.gaugePerInstance(
|
||||
"collaboration.documents_count",
|
||||
instance.getDocumentsCount()
|
||||
// -1 adjustment because hook is called before document is removed
|
||||
instance.getDocumentsCount() - 1
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,10 @@ export default async function documentUpdater({
|
||||
documentId,
|
||||
ydoc,
|
||||
userId,
|
||||
done,
|
||||
}: {
|
||||
documentId: string,
|
||||
ydoc: Y.Doc,
|
||||
userId: string,
|
||||
done?: boolean,
|
||||
}) {
|
||||
const document = await Document.findByPk(documentId);
|
||||
const state = Y.encodeStateAsUpdate(ydoc);
|
||||
|
||||
@@ -19,7 +19,9 @@ export default class DebounceProcessor {
|
||||
break;
|
||||
}
|
||||
case "documents.update.delayed": {
|
||||
const document = await Document.findByPk(event.documentId);
|
||||
const document = await Document.findByPk(event.documentId, {
|
||||
fields: ["updatedAt"],
|
||||
});
|
||||
|
||||
// If the document has been deleted then prevent further processing
|
||||
if (!document) return;
|
||||
|
||||
Reference in New Issue
Block a user