MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / get_proxies

Function get_proxies

src/database/crud.py:570–584  ·  view source on GitHub ↗

获取代理列表

(
    db: Session,
    enabled: Optional[bool] = None,
    skip: int = 0,
    limit: int = 100
)

Source from the content-addressed store, hash-verified

568
569
570def get_proxies(
571 db: Session,
572 enabled: Optional[bool] = None,
573 skip: int = 0,
574 limit: int = 100
575) -> List[Proxy]:
576 """获取代理列表"""
577 _ensure_single_default_proxy(db)
578 query = db.query(Proxy)
579
580 if enabled is not None:
581 query = query.filter(Proxy.enabled == enabled)
582
583 query = query.order_by(desc(Proxy.created_at)).offset(skip).limit(limit)
584 return query.all()
585
586
587def get_enabled_proxies(db: Session) -> List[Proxy]:

Callers

nothing calls this directly

Calls 4

allMethod · 0.80
queryMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected