from fastapi import FastAPI import time app = FastAPI() @app.get('/work') def work(): time.sleep(2) return 'done'