Commit abeea628 authored by novelailab's avatar novelailab

fix timer

parent 37445892
...@@ -89,10 +89,10 @@ def generate(request: GenerationRequest): ...@@ -89,10 +89,10 @@ def generate(request: GenerationRequest):
async def handle_logging_and_errors(request: Request, call_next): async def handle_logging_and_errors(request: Request, call_next):
t = time.perf_counter() t = time.perf_counter()
response = await call_next(request) response = await call_next(request)
process_time = time.time() - t process_time = time.perf_counter() - t
response.headers["X-Process-Time"] = str(process_time) response.headers["X-Process-Time"] = str(process_time)
logger.info(f"Request took {t:.3f} seconds") logger.info(f"Request took {t:.3f} seconds")
f = open("/tmp/health_readiness", "w") f = open("/tmp/health_readiness", "w")
f.close() f.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment