I couldn't find anything to confirm or deny this in the docs, but my guess is that all()
has a non-deterministic ordering such that eventually one of your fetch(1000)
's will hit the "last element" and devices.cursor()
will return nothing.
Try this:
devices = Pushdev.all().order('__key__')