INNER CODE UNIT · Python

put_outlook_mailboxes

AaronL725/grok-register · web/server.py:241

async def put_outlook_mailboxes(request: Request):
    _require_local_origin(request)
    payload = await request.json()
    if not isinstance(payload, dict) or not isinstance(payload.get("data"), str):
        raise HTTPException(status_code=400, detail="请求必须包含字符串字段 data")
    from outlook_mailbox_pool import save_outlook_mailbox_pool
    with _job_lock:
        if _job_state["running"]:
            raise HTTPException(status_code=409, detail="任务运行期间不能修改 Outlook 邮箱池")
        if _maintenance_state is not None:
            raise HTTPException(status_code=409, detail="维护操作期间不能修改 Outlook 邮箱池")
        engine.load_config()
        path = engine.config.get("outlook_accounts_file", "")
        try:
            summary = save_outlook_mailbox_pool(path, payload["data"])
        except (ValueError, RuntimeError, OSError) as exc:
            raise HTTPException(status_code=400, detail=str(exc)) from exc
    _append_log("[*] Outlook 邮箱池已保存: %s 个账号" % summary["count"])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…