fix ui project issue that once throw error, browser never restart; add the time gap for next time when encounter error.

This commit is contained in:
geekgeekrun
2024-03-10 23:50:11 +08:00
parent e9a95ddae5
commit 6ce92af189
3 changed files with 11 additions and 9 deletions
@@ -84,18 +84,14 @@ export async function mainLoop (hooks) {
})
hooks.puppeteerLaunched?.call()
page = await browser.newPage()
sleep(2000).then(() => {
page.bringToFront()
})
page = (await browser.pages())[0]
//set cookies
hooks.cookieWillSet?.call(bossCookies)
for(let i = 0; i < bossCookies.length; i++){
await page.setCookie(bossCookies[i]);
}
await setDomainLocalStorage(browser, localStoragePageUrl, bossLocalStorage)
await page.bringToFront()
let userInfoResponse
await Promise.all([
page.goto(recommendJobPageUrl, { timeout: 0 }),