add timeout for pages()

This commit is contained in:
2023-12-06 09:33:57 +01:00
parent e7a02a5c25
commit 0c18ae491c
2 changed files with 11 additions and 12 deletions
+9 -11
View File
@@ -721,7 +721,6 @@ class CommandorPage {
await this.mongoManager.saveReserveToDb(reserve.to_mongo_dict())
await this.page.close();
// await this.deleteFromBlackList()
// await this.resetBrowser()
this.isTerminated = true
}
@@ -751,7 +750,7 @@ class CommandorPage {
logWithDevice("resetBrowser", this.device);
this.isFillingFields = false;
this.cguChecked = false;
this.isNameInput = false;
this.isNameInputing = false;
this.isEmailFilled = false;
this.isCountryChoosen = false;
this.isPhoneInput = false;
@@ -805,15 +804,19 @@ class CommandorPage {
checkResult = await this.ocrChecker.get_result();
}
while (checkResult === OCRResult.SLIDING_CAPTCHA) {
logWithDevice("will call this.slidingCaptcha()", this.device)
await this.slidingCaptcha(async (isSuccessful) => {
logWithDevice("SLIDING_CAPTCHA result is " + isSuccessful, this.device)
console.log(checkResult);
if (isSuccessful) {
await delay(5 * 1000)
checkResult = await this.ocrChecker.get_result();
console.log(checkResult);
// checkResult = await this.ocrChecker.get_result();
await this.checkResultWithOcr()
} else {
checkResult = OCRResult.TERMINAED
this.isTerminated = true
if (checkResult === OCRResult.SLIDING_CAPTCHA) {
checkResult = OCRResult.TERMINAED
this.isTerminated = true
}
}
})
await delay(10 * 1000)
@@ -933,12 +936,7 @@ class CommandorPage {
break;
case
OCRResult.RECAPTCHA_ERROR:
// if (!this.isFillingFields)
this.isTerminated = true;
// else {
// await this.checkResultWithOcr();
// }
// await this.connect_to_browser(OCRResult.RECAPTCHA_ERROR)
break;
case
OCRResult.BRAVE_SKIP: