sync are sent upon DB commit

This commit is contained in:
zadam
2020-01-31 22:32:24 +01:00
parent 05b51c0f68
commit eeedb91ef7
8 changed files with 50 additions and 24 deletions

View File

@@ -1,3 +1,5 @@
import * as syncService from "../services/sync.js";
const setupRoute = require('./setup');
const loginRoute = require('./login');
const indexRoute = require('./index');
@@ -53,7 +55,7 @@ const csrfMiddleware = csurf({
});
function apiResultHandler(req, res, result) {
res.setHeader('trilium-max-sync-id', syncTableService.getMaxSyncId());
res.setHeader('trilium-max-sync-id', syncService.getMaxSyncId());
// if it's an array and first element is integer then we consider this to be [statusCode, response] format
if (Array.isArray(result) && result.length > 0 && Number.isInteger(result[0])) {