Update main.py
Browse files
main.py
CHANGED
@@ -71,7 +71,7 @@ async def rate_limiter_per_ip(request: Request):
|
|
71 |
else:
|
72 |
if rate_limit_store[client_ip]["count"] >= RATE_LIMIT:
|
73 |
logger.warning(f"Rate limit exceeded for IP address: {client_ip}")
|
74 |
-
raise HTTPException(status_code=429, detail='Rate limit exceeded for IP address')
|
75 |
rate_limit_store[client_ip]["count"] += 1
|
76 |
|
77 |
async def get_api_key(request: Request, authorization: str = Header(None)) -> str:
|
@@ -603,4 +603,4 @@ async def http_exception_handler(request: Request, exc: HTTPException):
|
|
603 |
|
604 |
if __name__ == "__main__":
|
605 |
import uvicorn
|
606 |
-
uvicorn.run(app, host="0.0.0.0", port=8000)
|
|
|
71 |
else:
|
72 |
if rate_limit_store[client_ip]["count"] >= RATE_LIMIT:
|
73 |
logger.warning(f"Rate limit exceeded for IP address: {client_ip}")
|
74 |
+
raise HTTPException(status_code=429, detail='Rate limit exceeded for IP address | NiansuhAI')
|
75 |
rate_limit_store[client_ip]["count"] += 1
|
76 |
|
77 |
async def get_api_key(request: Request, authorization: str = Header(None)) -> str:
|
|
|
603 |
|
604 |
if __name__ == "__main__":
|
605 |
import uvicorn
|
606 |
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|