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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user