added demo document SQL scripts

This commit is contained in:
azivner
2017-12-23 13:16:18 -05:00
parent 8bc12a2654
commit cf8334607e
7 changed files with 182 additions and 58 deletions

View File

@@ -9,6 +9,7 @@ const sync_table = require('../../services/sync_table');
const sql = require('../../services/sql');
const options = require('../../services/options');
const content_hash = require('../../services/content_hash');
const log = require('../../services/log');
router.get('/check', auth.checkApiAuth, async (req, res, next) => {
res.send({
@@ -29,6 +30,8 @@ router.post('/fill-sync-rows', auth.checkApiAuth, async (req, res, next) => {
await sync_table.fillSyncRows("recent_notes", "note_tree_id");
});
log.info("Sync rows have been filled.");
res.send({});
});
@@ -38,6 +41,8 @@ router.post('/force-full-sync', auth.checkApiAuth, async (req, res, next) => {
await options.setOption('last_synced_push', 0);
});
log.info("Forcing full sync.");
// not awaiting for the job to finish (will probably take a long time)
sync.sync();