예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
    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!")
예제 #4
0
    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!'
예제 #5
0
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)
예제 #6
0
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)