task queue in Appengine (using NDB) stopping another function from updating data

时间:2015-08-14 22:59:44

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

cred_query = credits_tbl.query(ancestor=user_key).fetch(1)

for q in cred_query:
    q.total_credits = q.total_credits + credits_bought
    q.put()

I have a task running which is constantly updating a users total_credits in the credits table.

While that task runs the user can also buy additional credits at any point (as shown in the code above) to add to the total. However, when they try to do so, it does not update the total_credits in the credits table.

I guess I don't understand the 'strongly consistent' modelling of appengine (using ndb) as well as I thought.

Do you know why this happens?

0 个答案:

没有答案