feat: page cache + save/load logic + db fixes

This commit is contained in:
Nicolas Giard
2018-09-15 20:58:23 -04:00
parent 572393aa7b
commit 2c6a95f900
9 changed files with 159 additions and 66 deletions

View File

@@ -20,7 +20,17 @@ module.exports = async (job) => {
input: output
})
}
console.info(output)
// Save to DB
await WIKI.models.pages.query()
.patch({ render: output })
.where('id', job.data.page.id)
// Save to cache
await WIKI.models.pages.savePageToCache({
...job.data.page,
render: output
})
WIKI.logger.info(`Rendering page ${job.data.page.path}: [ COMPLETED ]`)
} catch (err) {