Spaces:
Running
Running
Download auth_io.py from ZHIWEI666/ComfyUI-Ranking-API: direct link, hf CLI and curl.
- Browser
- Download file 692 Bytes
-
https://huggingface.co/spaces/ZHIWEI666/ComfyUI-Ranking-API/resolve/main/auth_io.py
- Command line
-
hf download hf://spaces/ZHIWEI666/ComfyUI-Ranking-API/auth_io.py
-
curl -L -o auth_io.py https://huggingface.co/spaces/ZHIWEI666/ComfyUI-Ranking-API/resolve/main/auth_io.py
692 Bytes
| """账号同步工作的有界准入与关闭等待。""" | |
| from fastapi import HTTPException | |
| from owned_thread import OwnedThreadGroup | |
| MAX_AUTH_IO = 8 | |
| MAX_IDENTITY_IO = 32 | |
| class AuthIO(OwnedThreadGroup): | |
| def __init__(self, capacity=MAX_AUTH_IO): | |
| super().__init__(capacity, lambda: HTTPException(status_code=503, detail='用户数据暂不可用')) | |
| _auth_io = AuthIO() | |
| run_auth_io = _auth_io.run | |
| start_auth_io = _auth_io.start | |
| stop_auth_io = _auth_io.stop | |
| close_auth_io = _auth_io.close | |
| _identity_io = AuthIO(MAX_IDENTITY_IO) | |
| run_identity_io = _identity_io.run | |
| start_identity_io = _identity_io.start | |
| stop_identity_io = _identity_io.stop | |
| close_identity_io = _identity_io.close | |