迭代AppEngine NDB时python中的BadRequestError

时间:2016-03-14 14:22:00

标签: python google-app-engine iterator google-cloud-datastore app-engine-ndb

这是一段简化的代码片段:

ndb_query_iter = ndbObject.query().iter(keys_only=True)
has_next = ndb_query_iter.has_next()
if has_next:
  while has_next:
    deferred.defer(doStuff, ndb_query_iter.next())
    has_next = ndb_query_iter.has_next()

我收到以下错误消息:

BadRequestError: invalid handle: <various ndb-id>

问题在于最后一行代码:

has_next = ndb_query_iter.has_next()

0 个答案:

没有答案