INNER CODE UNIT · Python
process_time
SearchSavior/OpenArc · src/server/main.py:35
process_time = time.time() - start_time
_access_logger.info(
f"Request completed: {request.method} {request.url.path} "
f"status={response.status_code} duration={process_time:.3f}s"
)
return response
except Exception as e:
process_time = time.time() - start_time
_access_logger.error(
f"Request failed: {request.method} {request.url.path} "
f"error={str(e)} duration={process_time:.3f}s"
)
raise
@asynccontextmanager
async def lifespan(app: FastAPI):
# Let OPENARC_STARTUP_MODELS (exported by `openarc serve start`) win over the