Skip to content

Commit 20e87ca

Browse files
glaforgefhinkel
authored andcommitted
Do not await the browser to close (GoogleCloudPlatform#653)
Awaiting for the headless browser to be closed add a certain amount of time to the duration of the request, although the image is already ready to be sent back to the user.
1 parent 41a569b commit 20e87ca

File tree

1 file changed

+1
-1
lines changed
  • appengine/headless-chrome

1 file changed

+1
-1
lines changed

appengine/headless-chrome/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ app.use(async (req, res) => {
3535
const page = await browser.newPage();
3636
await page.goto(url);
3737
const imageBuffer = await page.screenshot();
38-
await browser.close();
38+
browser.close();
3939

4040
res.set('Content-Type', 'image/png');
4141
res.send(imageBuffer);

0 commit comments

Comments
 (0)