ComfyUI-Ranking-API / auth_io.py
ZHIWEI666's picture
Upload 30 files
2411edd verified
Raw History Blame Contribute Delete
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