From 830ddd9d2ce69b01a349c9cd161ca1a536ed8f99 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 2 Feb 2019 16:59:00 -0500 Subject: [PATCH] fix: await page render to finish before resolving --- .gitignore | 2 ++ CHANGELOG.md | 1 + README.md | 2 +- server/models/pages.js | 3 ++- server/modules/storage/disk/definition.yml | 1 - server/modules/storage/git/definition.yml | 4 ++++ 6 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 697b511487..962828155c 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,8 @@ npm-debug.log* # Generated assets /assets +server/views/master.pug +server/views/setup.pug # Webpack .webpack-cache diff --git a/CHANGELOG.md b/CHANGELOG.md index 45f7ffb6df..bd82a81870 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fixed root admin refresh token fail - Fixed error page metadata title warning - Fixed telemetry +- Await page render job to complete before resolving ### Changed - Moved Insert Media button in Markdown editor diff --git a/README.md b/README.md index 07d4168af5..42d53cc619 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Wiki.js can run on virtually all platforms where Node.js can (Windows, Mac, Linu - MariaDB **10.2.7** or later - Microsoft SQL Server **2012** or later - SQLite **3.9** or later -- Redis **3.2** or later +- Redis **3.0** or later > Read the full [prerequisites](https://docs-beta.requarks.io/install/requirements) article for full details. diff --git a/server/models/pages.js b/server/models/pages.js index 58bcceff3c..8a846a6a15 100644 --- a/server/models/pages.js +++ b/server/models/pages.js @@ -197,13 +197,14 @@ module.exports = class Page extends Model { static async renderPage(page) { const pipeline = await WIKI.models.renderers.getRenderingPipeline(page.contentType) - WIKI.queue.job.renderPage.add({ + const renderJob = await WIKI.queue.job.renderPage.add({ page, pipeline }, { removeOnComplete: true, removeOnFail: true }) + return renderJob.finished() } static async getPage(opts) { diff --git a/server/modules/storage/disk/definition.yml b/server/modules/storage/disk/definition.yml index 9a6250a232..54caf3c454 100644 --- a/server/modules/storage/disk/definition.yml +++ b/server/modules/storage/disk/definition.yml @@ -5,7 +5,6 @@ author: requarks.io logo: https://static.requarks.io/logo/local-fs.svg website: https://wiki.js.org supportedModes: - - sync - push props: path: diff --git a/server/modules/storage/git/definition.yml b/server/modules/storage/git/definition.yml index 60eecbfdc7..f4743e8f42 100644 --- a/server/modules/storage/git/definition.yml +++ b/server/modules/storage/git/definition.yml @@ -4,6 +4,10 @@ description: Git is a version control system for tracking changes in computer fi author: requarks.io logo: https://static.requarks.io/logo/git-alt.svg website: https://git-scm.com/ +supportedModes: + - sync + - push + - pull props: authType: type: String