mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
partial sync requests WIP
This commit is contained in:
@@ -162,6 +162,8 @@ function update(req) {
|
||||
|
||||
partialRequests[requestId].payload += req.body;
|
||||
|
||||
log.info(`Receiving partial request ${requestId}, page index ${pageIndex} out of ${pageCount} pages.`);
|
||||
|
||||
if (pageIndex !== pageCount - 1) {
|
||||
return;
|
||||
}
|
||||
@@ -180,7 +182,9 @@ function update(req) {
|
||||
|
||||
setInterval(() => {
|
||||
for (const key in partialRequests) {
|
||||
if (partialRequests[key].createdAt - Date.now() > 5 * 60 * 1000) {
|
||||
if (Date.now() - partialRequests[key].createdAt > 5 * 60 * 1000) {
|
||||
log.info(`Cleaning up unfinished partial requests for ${key}`);
|
||||
|
||||
delete partialRequests[key];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user