def flushSpotUpdate(cls, publisherUrl, spotPosition): key = cls.getSpotKey_(publisherUrl, spotPosition) updated = memcache.get(key) if updated: spot = model.getSpot(publisherUrl, spotPosition) clone = copy.deepcopy(updated) updated.reset(clone) # reset counters as soon as possible and write into memcache memcache.set(key, updated) spot.updateStats(clone) spot.put()
def post(self): try: BaseHandler.initFromRequest(self, self.request) #spot is space delimited list of spots spots = self.getParam('spot').split(" ") spotsWithStats = [] for spot in spots: spotsWithStats.append(model.getSpot(self.getParam('publisherUrl'), int(spot))) self.common_response.setSpots(spotsWithStats) except Exception: BaseHandler.logException(self) BaseHandler.writeResponse(self)