Serialize Odin provider document persistence
This commit is contained in:
parent
17d45abe06
commit
ba76a7239a
2 changed files with 4 additions and 5 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -77,8 +77,9 @@ function createCultMeshRudpDocumentServer(options) {
|
|||
},
|
||||
onDocumentPutRaw: (document) => {
|
||||
if (typeof options.onDocumentPutRaw === "function") {
|
||||
options.onDocumentPutRaw(document);
|
||||
return options.onDocumentPutRaw(document);
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue