正在获取500:前提条件修补文件夹时失败.为什么? [英] Getting 500: Precondition Failed when Patching a folder. Why?
问题描述
间歇地,当我在文件夹上运行Patch(Java客户端库)以更新其状态时,我看到了来自Drive的此错误.重试并不能解决问题.
Intermittently, I'm seeing this error from Drive when I run Patch (Java client library) on a folder to update its status. Retrying doesn't make the problem go away.
我猜是...
- 这实际上应该是412(而不是500)
- 补丁程序正在进行etag比较,而通过将代码更改为更新",它将不会
之前,我已更改代码以使用Update,但是由于问题是间歇性的,因此无法确定我的解决方案是否有效.如果有权访问某些文档的人可以确认(或将我指出正确的方向),那就太好了.
fwiw I've changed my code to use Update, but since the problem is intermittent, I can't be sure that my resolution is valid. It would be great if somebody with access to some documentation could confirm (or point me in the right direction).
代码是...
driveService.files().patch(enFolder.getId(),enFolder).execute();
推荐答案
如果您具有文件的最新状态,则可以安全地使用update,Drive API即使在您遇到的情况下也不会响应412,因为您没有设置If-Match
标头.
You can use update safely if you have the latest state of the file, Drive API should not respond even with a 412 in your case, because you're not setting an If-Match
header.
这篇关于正在获取500:前提条件修补文件夹时失败.为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!