def consume_scoring(self, *args, **kwargs):
        consumed = 0
        seen = set()
        batch = []
        for m in self.scoring_log_consumer.get_messages(count=self.consumer_batch_size):
            try:
                msg = self._decoder.decode(m)
            except (__HOLE__, TypeError), e:
                logger.error("Decoding error: %s", e)
                continue
            else:
                if msg[0] == 'update_score':
                    _, fprint, score, url, schedule = msg
                    if fprint not in seen:
                        batch.append((fprint, score, Request(url), schedule))
                    seen.add(fprint)
                if msg[0] == 'new_job_id':
                    self.job_id = msg[1]
            finally:
                consumed += 1
        self.queue.schedule(batch)

        logger.info("Consumed %d items during scoring consumption.", consumed)
        self.stats['last_consumed_scoring'] = consumed
        self.stats['last_consumption_run_scoring'] = asctime()
        self.slot.schedule()
dataset/ETHPy150Open scrapinghub/frontera/frontera/worker/db.py/DBWorker.consume_scoring