def write_review(review, pnm, acc): set_review_mainfeed(review, acc) mctr.synchronized_db_write(review) logging.info("write_review wrote Review " + str(review.key().id())) # update all related cached data, or clear it for later rebuild mfeed.update_feed_caches(review, addifnew=True) update_profile("pen", pnm, review)
def update_review_caches(review): mfeed.update_feed_caches(review) update_prof_cache("pen" + str(review.penid), review) if review.svcdata: svcdict = json.loads(review.svcdata) if "postctms" in svcdict: for ctmpost in svcdict["postctms"]: update_prof_cache("coop" + ctmpost["ctmid"], review) # If the standard instance cached was used, update it, but do not # generally cache individual Review instances. mkey = "Review" + str(review.key().id()) cached = memcache.get(mkey) if cached: memcache.set(mkey, pickle.dumps(review))