使用可恢复上传将文件上传到谷歌云端存储并在上传最后一个块后获取2xx代码时,有时需要几秒钟才能收到通知,有时它们会被延迟多达40个!分钟。这极不可预测,导致用户体验不佳。
some1可以帮助我并解释我可能做错了吗?
对钩子的响应示例(我确实用2xx状态码正确接受它们)
{
"name": "core-api",
"hostname": "http-in-production-0",
"pid": 1,
"namespace": "audit",
"audit": true,
"level": 30,
"remoteAddress": "10.240.0.6",
"remotePort": 36689,
"req_id": "6feb5f2a-82aa-4d24-b844-2db915868fd3",
"req": {
"query": {},
"method": "POST",
"url": "/api/files/gce",
"headers": {
"host": "redacted.com",
"accept-encoding": "gzip",
"cf-ipcountry": "US",
"x-forwarded-for": "66.102.6.238",
"cf-ray": "2bba889f9fcb5011-DEN",
"content-length": "1306",
"cf-visitor": "{\"scheme\":\"https\"}",
"accept": "*/*",
"x-goog-channel-id": "cdn-channel-id-redacted",
"x-goog-resource-state": "exists",
"x-goog-message-number": "9748944617",
"x-goog-resource-id": "-----resource-id------",
"x-goog-resource-uri": "https://www.googleapis.com/storage/v1/b/cdn.redacted.com/o?alt=json",
"x-goog-channel-token": "secret-token-redacted",
"content-type": "application/json; charset=UTF-8",
"user-agent": "APIs-Google; (+https://developers.google.com/webmasters/APIs-Google.html)",
"cf-connecting-ip": "66.102.6.238",
"x-forwarded-proto": "https",
"connection": "close"
},
"httpVersion": "1.1",
"trailers": {},
"version": "*",
"timers": {
"remapXFFheader": 32,
"restifyCORSSimple": 16,
"parseAccept": 120,
"parseQueryString": 22,
"gzip": 887,
"checkIfMatch": 27,
"checkIfNoneMatch": 22,
"checkIfModified": 45,
"checkIfUnmodified": 18,
"remapContentType": 10,
"readBody": 343,
"parseBody": 57,
"restifyLogger": 205,
"attachAMQP": 19,
"initContext": 12,
"activateAccount": 542,
"handeReact": 411,
"responseContentType": 27,
"gceWebhook": 304,
"completeResumableUpload": 55245
}
},
"res": {
"statusCode": 202,
"headers": {
"content-encoding": "gzip",
"content-type": "application/vnd.api+json"
},
"trailer": false
},
"err": null,
"latency": 63,
"_audit": true,
"msg": "handled: 202",
"time": "2016-07-01T14:26:33.645Z",
"v": 0
}
答案 0 :(得分:0)
请参阅文档的Reliable Delivery部分。特别是,我在这里引用:
对象更改通知将尝试向其发送通知 您的申请以可靠的方式进行。但是,请注意 通知可以无限期延迟,而且及时性不是 保证。