mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Revert "close browser when request finished"
This reverts commit 7e68ad5237.
This commit is contained in:
parent
7e68ad5237
commit
11f20ab64a
2 changed files with 5 additions and 5 deletions
|
|
@ -16,7 +16,7 @@ app.get('/', (req, res) => {
|
|||
res.send(403)
|
||||
return
|
||||
}
|
||||
return fetchContent(req, res)
|
||||
fetchContent(req, res)
|
||||
});
|
||||
|
||||
app.post('/', (req, res) => {
|
||||
|
|
@ -25,7 +25,7 @@ app.post('/', (req, res) => {
|
|||
res.send(403)
|
||||
return
|
||||
}
|
||||
return fetchContent(req, res)
|
||||
fetchContent(req, res)
|
||||
});
|
||||
|
||||
const PORT = parseInt(process.env.PORT) || 8080;
|
||||
|
|
@ -34,4 +34,4 @@ app.listen(PORT, () => {
|
|||
console.log('Press Ctrl+C to quit.');
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
module.exports = app;
|
||||
|
|
@ -380,7 +380,7 @@ async function fetchContent(req, res) {
|
|||
console.log(`parse-page`, logRecord);
|
||||
} finally {
|
||||
if (context) {
|
||||
await context.browser().close();
|
||||
await context.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -552,7 +552,7 @@ async function retrievePage(url) {
|
|||
if (lastPdfUrl) {
|
||||
return { context, page, finalUrl: lastPdfUrl, contentType: 'application/pdf' };
|
||||
}
|
||||
await browser.close();
|
||||
await context.close();
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue