fix(core): update

This commit is contained in:
2021-05-19 01:33:58 +00:00
parent 6b381d6115
commit b1aae3e5b9
3 changed files with 2170 additions and 1208 deletions

View File

@ -43,6 +43,17 @@ export class SmartSSR {
const resultDeferred = plugins.smartpromise.defer<string>();
const context = await this.browser.getNewIncognitoContext();
const page = await context.newPage();
// lets protext against left open tabs
plugins.smartdelay.delayFor(30000).then(() => {
if (!page.isClosed) {
page.close();
context.close();
throw new Error(`failed to render ${urlArg}`);
}
});
page.on('console', (msg) => {
console.log(`${urlArg}: ${msg.text()}`);
});
@ -71,6 +82,7 @@ export class SmartSSR {
renderTimeMeasurement.stop();
// lets clean up async
await page.close();
await context.close();
overallTimeMeasurement.stop();