make polling timeout configurable and 5mins by default (#789)
This commit is contained in:
@@ -119,6 +119,7 @@ class Settings(BaseSettings):
|
|||||||
|
|
||||||
# TOTP Settings
|
# TOTP Settings
|
||||||
TOTP_LIFESPAN_MINUTES: int = 10
|
TOTP_LIFESPAN_MINUTES: int = 10
|
||||||
|
VERIFICATION_CODE_POLLING_TIMEOUT_MINS: int = 5
|
||||||
|
|
||||||
def is_cloud_environment(self) -> bool:
|
def is_cloud_environment(self) -> bool:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ BROWSER_CLOSE_TIMEOUT = 180 # 3 minute
|
|||||||
# reserved fields for navigation payload
|
# reserved fields for navigation payload
|
||||||
SPECIAL_FIELD_VERIFICATION_CODE = "verification_code"
|
SPECIAL_FIELD_VERIFICATION_CODE = "verification_code"
|
||||||
|
|
||||||
VERIFICATION_CODE_POLLING_TIMEOUT_MINS = 10
|
|
||||||
|
|
||||||
|
|
||||||
class ScrapeType(StrEnum):
|
class ScrapeType(StrEnum):
|
||||||
NORMAL = "normal"
|
NORMAL = "normal"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ from deprecation import deprecated
|
|||||||
from playwright.async_api import FileChooser, Locator, Page, TimeoutError
|
from playwright.async_api import FileChooser, Locator, Page, TimeoutError
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
from skyvern.constants import REPO_ROOT_DIR, SKYVERN_ID_ATTR, VERIFICATION_CODE_POLLING_TIMEOUT_MINS
|
from skyvern.constants import REPO_ROOT_DIR, SKYVERN_ID_ATTR
|
||||||
from skyvern.exceptions import (
|
from skyvern.exceptions import (
|
||||||
EmptySelect,
|
EmptySelect,
|
||||||
ErrEmptyTweakValue,
|
ErrEmptyTweakValue,
|
||||||
@@ -2099,7 +2099,7 @@ async def poll_verification_code(
|
|||||||
totp_verification_url: str | None = None,
|
totp_verification_url: str | None = None,
|
||||||
totp_identifier: str | None = None,
|
totp_identifier: str | None = None,
|
||||||
) -> str | None:
|
) -> str | None:
|
||||||
timeout = timedelta(minutes=VERIFICATION_CODE_POLLING_TIMEOUT_MINS)
|
timeout = timedelta(minutes=SettingsManager.get_settings().VERIFICATION_CODE_POLLING_TIMEOUT_MINS)
|
||||||
start_datetime = datetime.utcnow()
|
start_datetime = datetime.utcnow()
|
||||||
timeout_datetime = start_datetime + timeout
|
timeout_datetime = start_datetime + timeout
|
||||||
org_token = await app.DATABASE.get_valid_org_auth_token(organization_id, OrganizationAuthTokenType.api)
|
org_token = await app.DATABASE.get_valid_org_auth_token(organization_id, OrganizationAuthTokenType.api)
|
||||||
|
|||||||
Reference in New Issue
Block a user