feat: page timeout (#22)

Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
Ion Caza
2020-09-18 19:04:29 -04:00
committed by GitHub
parent 7d7bd18b4d
commit 643045c7e0
4 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -16,7 +16,8 @@ const notifications = {
const page = {
height: 1920,
userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',
width: 1080
width: 1080,
navigationTimeout: Number(process.env.PAGE_TIMEOUT) ?? 30000
};
const stores = process.env.STORES ?? 'nvidia';
+1
View File
@@ -40,6 +40,7 @@ async function lookup(store: Store) {
for (const link of store.links) {
const browser = await puppeteer.launch();
const page = await browser.newPage();
page.setDefaultNavigationTimeout(Config.page.navigationTimeout);
await page.setUserAgent(Config.page.userAgent);
await page.setViewport({
height: Config.page.height,