I'm working on a lightweight app, and I have quite a few situations where the user submits a form, the form data is processed and pushed to the datastore, and then the user is redirected to a page that displays some of the same data. It's quite often the case that the user gets to the page before the datastore has been updated, so they see old data. Is there any way to have the app wait for the datastore to update before proceeding? The obvious hacky solution is calling sleep(1)
, but that's obviously not ideal and takes longer than the actual update.
相关问题
- java.lang.NullPointerException at java.io.PrintWri
- Flush single app django 1.9
- __call__() missing 1 required positional argument:
- Upload file to Google Cloud Storage using AngularJ
- Where is the best place to put one-time and every-
相关文章
- Is there a size limit for HTTP response headers on
- Does there exist empty class in python?
- ImportError: No module named twisted.persisted.sty
- appcfg.py command not found
- Get a header with Python and convert in JSON (requ
- Google app engine datastore string encoding proble
- python unit testing methods inside of classes
- Requiring tensorflow with Python 2.7.11 occurs Imp
Just get the key the
.put()
returns:and pass it on to the other page (e.g via
urlsafe
). The other page can rebuild the key and thenwill always give you updated data -- i.e, this (
key.get()
) is one simple way to get strong consistency from the GAE datastore!