api/server.py
async def add_process_time_header(request: Request, call_next):
    """Add X-Process-Time to all requests for logging"""
    start_time = time.time()
    response = await call_next(request)
    process_time = time.time() - start_time
    response.headers['X-Process-Time'] = f'{round(process_time * 1000, 1)}ms'
    return response
Add X-Process-Time to all requests for logging
Add X-Process-Time to all requests for logging
Add X - Process - Time to all requests for logging
async def add_process_time_header(request: Request, call_next):
    start_time = time.time()
    response = await call_next(request)
    process_time = time.time() - start_time
    response.headers['X-Process-Time'] = f'{round(process_time * 1000, 1)}ms'
    return response
async def add_process_time_header ( request : Request , call_next ) : start_time = time . time ( ) response = await call_next ( request ) process_time = time . time ( ) - start_time response . headers [ 'X-Process-Time' ] = f'{round(process_time * 1000, 1)}ms' return response
Add X-Process-Time to all requests for logging
Add X - Process - Time to all requests for logging
"""Add X-Process-Time to all requests for logging"""
request
Request
call_next