【发布时间】:2021-09-23 01:44:35
【问题描述】:
下面的函数正在调用 create_presigned_url 但我在等待时遇到错误。
def getPreSignedURL(request: Request, file: UploadFile = File(...) ):
resp = await create_presigned_url(request,file)
return resp
这是我要调用的异步函数
async def create_presigned_url(bucket_name, object_name, expiration=3600):
---
return response
【问题讨论】:
-
请提供错误。
-
您不能从同步方法调用异步方法。欲了解更多信息stackoverflow.com/questions/55647753/…
-
您不能如上所述从常规函数调用异步函数。您需要使用 asyncio。
-
@tomarv 在哪里使用这个异步?
标签: python async-await fastapi