def rebuild(self):
    self.start_time = time.time()
    self.last_logging_time = time.time()
    self.finished_tasks = 0
    logging.debug(('Start to rebuild Suggestion Cache for site: %s' % self.site_id))
    self.tasks.append((tuple(), 1000000, 0))
    while (len(self.tasks) > 0):
        task = self.tasks.pop(0)
        self.process_task(*task)
    finish_time = time.time()
    logging.debug(('Finished to rebuild Suggestion Cache for site: %s, total time spent: %s seconds.' % (self.site_id, (finish_time - self.start_time))))
def rebuild(self):
    self.start_time = time.time()
    self.last_logging_time = time.time()
    self.finished_tasks = 0
    logging.debug(('Start to rebuild Suggestion Cache for site: %s' % self.site_id))
    self.tasks.append((tuple(), 1000000, 0))
    while (len(self.tasks) > 0):
        task = self.tasks.pop(0)
        self.process_task(*task)
    finish_time = time.time()
    logging.debug(('Finished to rebuild Suggestion Cache for site: %s, total time spent: %s seconds.' % (self.site_id, (finish_time - self.start_time))))