1
0
mirror of synced 2025-12-25 02:17:36 -05:00

Speed up warmServer by loading pages (and files) asynchronously (#16752)

* Async `new Page`

* Update pages.js

* Update pages.js

* Update pages.js

* Update pages.js

* Update pages.js

* Using mapLimit

* Update pages.js

* Test updates

* Update pages.js

* Move exists to page class

* Test fixes

* Slightly faster localized paths process
This commit is contained in:
Kevin Heis
2020-12-09 08:57:18 -08:00
committed by GitHub
parent ee7c1bce3d
commit 1d5e216404
10 changed files with 142 additions and 103 deletions

View File

@@ -17,8 +17,8 @@ describe('redirects', () => {
done()
})
test('page.redirects is an array', () => {
const page = new Page({
test('page.redirects is an array', async () => {
const page = await Page.init({
relativePath: 'github/collaborating-with-issues-and-pull-requests/about-branches.md',
basePath: path.join(__dirname, '../../content'),
languageCode: 'en'
@@ -26,8 +26,8 @@ describe('redirects', () => {
expect(isPlainObject(page.redirects)).toBe(true)
})
test('dotcom homepage page.redirects', () => {
const page = new Page({
test('dotcom homepage page.redirects', async () => {
const page = await Page.init({
relativePath: 'github/index.md',
basePath: path.join(__dirname, '../../content'),
languageCode: 'en'
@@ -41,7 +41,7 @@ describe('redirects', () => {
})
test('converts single `redirect_from` strings values into arrays', async () => {
const page = new Page({
const page = await Page.init({
relativePath: 'github/collaborating-with-issues-and-pull-requests/about-conversations-on-github.md',
basePath: path.join(__dirname, '../../content'),
languageCode: 'en'