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

Function update_proxy

src/database/crud.py:592–608  ·  view source on GitHub ↗

更新代理配置

(
    db: Session,
    proxy_id: int,
    **kwargs
)

Source from the content-addressed store, hash-verified

590
591
592def update_proxy(
593 db: Session,
594 proxy_id: int,
595 **kwargs
596) -> Optional[Proxy]:
597 """更新代理配置"""
598 db_proxy = get_proxy_by_id(db, proxy_id)
599 if not db_proxy:
600 return None
601
602 for key, value in kwargs.items():
603 if hasattr(db_proxy, key):
604 setattr(db_proxy, key, value)
605
606 db.commit()
607 db.refresh(db_proxy)
608 return db_proxy
609
610
611def delete_proxy(db: Session, proxy_id: int) -> bool:

Callers

nothing calls this directly

Calls 1

get_proxy_by_idFunction · 0.85

Tested by

no test coverage detected