Add login timer
This commit is contained in:
parent
d4025dd32d
commit
4310220c58
@ -3,5 +3,6 @@
|
||||
"startDateIso": "2023-01-01",
|
||||
"endDateIso": "2023-12-31",
|
||||
"uberPath": "./uberResults.json",
|
||||
"chromeExecutable": "/usr/bin/chromium"
|
||||
"chromeExecutable": "/usr/bin/chromium",
|
||||
"uberLoginSeconds": 100
|
||||
}
|
||||
|
@ -11,13 +11,13 @@ export async function loginToUber(page, options, testForHeaders) {
|
||||
)
|
||||
await page.click('button[type="submit"]')
|
||||
|
||||
for (let i = 0; i < 100; i++) {
|
||||
await utils.sleep(700)
|
||||
for (let i = 0; i < options.uberLoginSeconds ?? 100; i++) {
|
||||
await utils.sleep(1000)
|
||||
if (testForHeaders()) {
|
||||
console.log("success")
|
||||
break
|
||||
}
|
||||
if (i == 99) {
|
||||
if (i == (options.uberLoginSeconds ?? 100) - 1) {
|
||||
throw "Slept too long."
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user