Skip to content

Commit

Permalink
Merge pull request railwayapp#4 from railwayapp/j/always-generate-new…
Browse files Browse the repository at this point in the history
…-page

always generate new puppeteer page
  • Loading branch information
coffee-cup authored Sep 28, 2021
2 parents 6484733 + 6702417 commit a8ab00a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/pages/api/_lib/chromium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ import core from "puppeteer-core";
import { OG_HEIGHT, OG_WIDTH } from "../../../constants";
import { FileType } from "../../../types";
import { getOptions } from "./options";
let _page: core.Page | null;

// test
async function getPage(isDev: boolean) {
if (_page) {
return _page;
}
const options = await getOptions(isDev);
const browser = await core.launch(options);
_page = await browser.newPage();
return _page;
return await browser.newPage();
}

export async function getScreenshot(
Expand Down

0 comments on commit a8ab00a

Please sign in to comment.