简体   繁体   English

检查 GCP 存储中是否存在 object,但检查方法必须在 python 中为异步

[英]Check if a object exist in GCP storage but the check method must be async in python

is there any ASYNC way to check if a file object exist in GCP Storage using Python?是否有任何异步方法使用 Python 检查文件 object 是否存在于 GCP 存储中?

i need to check if a batch of files exist in gcp storage, but the method described in the documentation is blocking my application and execution time is to late, i want to make the app check the files more faster than now我需要检查 gcp 存储中是否存在一批文件,但是文档中描述的方法阻塞了我的应用程序并且执行时间太晚了,我想让应用程序比现在更快地检查文件

I found this module (gcloud-aio-storage) to make asynchronous uploads and downloads in the storage, I use its download function and if it raises an error I consider that the file does not exist.我发现这个模块(gcloud-aio-storage)在存储中进行异步上传和下载,我使用它的下载 function 如果它引发错误我认为该文件不存在。

another way suggested by Guillaume blaquiere is to make the http calls directly in the storage api if you know your full file path, without using the gcp libraries for python, you can find the documentation here storage api endpoints Guillaume blaquiere 建议的另一种方法是直接在存储 api 中调用 http 如果您知道完整的文件路径,而不使用 python 的 gcp 库,您可以在此处找到文档存储 api 端点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM