Serialize Odin provider document persistence

This commit is contained in:
Meta Vens 2026-08-23 19:41:59 +02:00
commit ba76a7239a
2 changed files with 4 additions and 5 deletions

View file

@ -76,7 +76,7 @@ async function main() {
}
return (await meshNodePromise).cache;
},
onDocumentPutRaw: (document) => {
onDocumentPutRaw: async (document) => {
if (observedRudpDocuments < 40) {
observedRudpDocuments += 1;
console.error(
@ -84,9 +84,7 @@ async function main() {
);
}
liveProviderRegistry.ingestDocument(document, document.remote);
persistRudpDocumentPut(document).catch((error) => {
console.error("CultMesh/RUDP document persist failed:", error.message);
});
await persistRudpDocumentPut(document);
},
});
await cultMeshRudpDocumentServer.start();

View file

@ -77,8 +77,9 @@ function createCultMeshRudpDocumentServer(options) {
},
onDocumentPutRaw: (document) => {
if (typeof options.onDocumentPutRaw === "function") {
options.onDocumentPutRaw(document);
return options.onDocumentPutRaw(document);
}
return undefined;
},
},
);