AppEngine数据存储超时在达到30秒限制之前抛出错误 [英] AppEngine Datastore Timeout Error thrown before 30s limit reached

查看:115
本文介绍了AppEngine数据存储超时在达到30秒限制之前抛出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用AppEngine Go时,从40k实体的表中读取时,我总是看到这个错误:

API错误5(datastore_v3:TIMEOUT):数据存储操作超时,或数据暂时不可用。



这发生在查询触发400毫秒内。



谢谢!

解决方案

发现每个单独的API调用都有5秒的超时时间。如果你需要更多时间,你可以像这样包装你的上下文:

  ctx:= appengine.Timeout(appengine.NewContext(req ),30 * time.Second)


Using AppEngine Go, I'm consistently seeing this error when reading from tables on the order of 40k entities:

API error 5 (datastore_v3: TIMEOUT): The datastore operation timed out, or the data was temporarily unavailable.

This is happening within 400ms of the query firing.

Is there something else that could cause this error besides hitting a limit on the wall clock?

Thanks!

解决方案

Turns out each individual API call has a 5s timeout. If you need more time, you can wrap your context like so:

ctx := appengine.Timeout(appengine.NewContext(req), 30*time.Second)

这篇关于AppEngine数据存储超时在达到30秒限制之前抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆