admin now runs
This commit is contained in:
@@ -10,10 +10,6 @@ import uvicorn
|
||||
|
||||
from admin.models import get_active_flow_config, init_db, insert_run
|
||||
from config import config
|
||||
from crawler.driver import driver_session
|
||||
from crawler.dynamic_flow import DynamicFlow
|
||||
from crawler.scenarios.fresh_session import FreshSessionScenario
|
||||
from crawler.scenarios.otp_login import OTPLoginScenario
|
||||
|
||||
|
||||
def _load_active_flow() -> dict[str, object]:
|
||||
@@ -56,6 +52,10 @@ def _record(
|
||||
|
||||
|
||||
def run_otp(phone: str) -> None:
|
||||
from crawler.driver import driver_session
|
||||
from crawler.dynamic_flow import DynamicFlow
|
||||
from crawler.scenarios.otp_login import OTPLoginScenario
|
||||
|
||||
def otp_resolver(p: str) -> str:
|
||||
# TODO: wire up your SMS gateway / webhook here.
|
||||
raise NotImplementedError("Implement otp_resolver to fetch OTP from your SMS gateway")
|
||||
@@ -73,6 +73,10 @@ def run_otp(phone: str) -> None:
|
||||
|
||||
|
||||
def run_fresh() -> None:
|
||||
from crawler.driver import driver_session
|
||||
from crawler.dynamic_flow import DynamicFlow
|
||||
from crawler.scenarios.fresh_session import FreshSessionScenario
|
||||
|
||||
flow_cfg = _load_active_flow()
|
||||
t0 = time.monotonic()
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user