We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 096c468 + ed0d876 commit 63bac7dCopy full SHA for 63bac7d
1 file changed
app/api/dependencies/auth.py
@@ -1,3 +1,4 @@
1
+import time
2
from typing import Annotated
3
4
import httpx
@@ -19,7 +20,7 @@ async def _verify_token(token: str) -> bool:
19
20
}
21
22
"""
-
23
+ start = time.perf_counter()
24
try:
25
async with httpx.AsyncClient() as client:
26
response = await client.post(
@@ -32,6 +33,9 @@ async def _verify_token(token: str) -> bool:
32
33
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
34
detail="Unable to verify user access",
35
)
36
+ finally:
37
+ elapsed = time.perf_counter() - start
38
+ logger.info(f"Token verification elapsed time: {elapsed:.4f}s")
39
40
payload = response.json()["data"]["verifyToken"]["payload"]
41
return payload["has_chatbot_access"]
0 commit comments