Add login timer

This commit is contained in:
PAlexanderFranklin 2024-02-06 05:57:14 -08:00
parent d4025dd32d
commit 4310220c58
2 changed files with 5 additions and 4 deletions

View File

@ -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
}

View File

@ -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."
}
}