Skip to content

Commit

Permalink
fix(downloader): open browser once instead of on every request
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvanherwijnen committed Dec 29, 2024
1 parent 8bdd766 commit 888afa2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/downloader/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ await app.register(fastifyRateLimit, {
timeWindow: '1 minute'
})

const browser = await chromium.launch({})

app.get(
'/',
async (
Expand All @@ -26,7 +28,6 @@ app.get(
}
app.log.info(host)
app.log.info(uuid)
const browser = await chromium.launch({})
const page = await browser.newPage({
ignoreHTTPSErrors: !!process.env.DEV
})
Expand Down

0 comments on commit 888afa2

Please sign in to comment.