def build_stats(drink_id, rebuild_following): logger.info("build_stats drink_id={} rebuild_following={}".format(drink_id, rebuild_following)) with transaction.atomic(): if rebuild_following: stats.rebuild_from_id(drink_id) else: stats.build_for_id(drink_id)
def build_stats(drink_id, rebuild_following): logger.info('build_stats drink_id={} rebuild_following={}'.format( drink_id, rebuild_following)) with transaction.atomic(): if rebuild_following: stats.rebuild_from_id(drink_id) else: stats.build_for_id(drink_id)
def handle(self, *args, **options): num_drinks = models.Drink.objects.all().count() self.pos = 0 def cb(results, self=self): self.pos += 1 progbar("regenerating stats", self.pos, num_drinks) stats.invalidate_all() stats.rebuild_from_id(0, cb=cb) print("") print("done!")
def handle(self, **options): num_drinks = models.Drink.objects.all().count() self.pos = 0 def cb(results, self=self): self.pos += 1 progbar('regenerating stats', self.pos, num_drinks) stats.invalidate_all() stats.rebuild_from_id(0, cb=cb) print '' print 'done!'
def build_stats(since_drink_id): logger.info('build_stats since_drink_id={}'.format(since_drink_id)) with transaction.atomic(): stats.rebuild_from_id(since_drink_id)