def run(self): """ Run the RPCitation to rebuild index """ if not self._checkparam(): return None self.started = datetime.now() logger.info('Start RPCitation Script (R-Index citation)') icitation = ICitation(hosts=self.options.source_index) cite_total = icitation.count_citation() logger.info('Total of itens that will be re-index on ``%s``: %d' % (self.options.target_index, cite_total)) ricitation = ICitation(hosts=self.options.target_index) with ProgressBar(maxval=cite_total) as progress: for index, cite in enumerate(icitation.get_all()): ricitation.index_citation(self._get_meta(cite)) progress.update(index) self.finished = datetime.now() logger.info("Total processing time: %s sec." % self._duration())