app.py
CHANGED
|
@@ -10,10 +10,12 @@ async def root():
|
|
| 10 |
|
| 11 |
@app.get("/info_sync")
|
| 12 |
def info_sync():
|
|
|
|
| 13 |
time.sleep(5)
|
| 14 |
return {"message": "sync"}
|
| 15 |
|
| 16 |
@app.get("/info_async")
|
| 17 |
async def info_async():
|
|
|
|
| 18 |
await asyncio.sleep(5)
|
| 19 |
return {"message": "async"}
|
|
|
|
| 10 |
|
| 11 |
@app.get("/info_sync")
|
| 12 |
def info_sync():
|
| 13 |
+
print("sync")
|
| 14 |
time.sleep(5)
|
| 15 |
return {"message": "sync"}
|
| 16 |
|
| 17 |
@app.get("/info_async")
|
| 18 |
async def info_async():
|
| 19 |
+
print("async")
|
| 20 |
await asyncio.sleep(5)
|
| 21 |
return {"message": "async"}
|