Skip to content

Commit

Permalink
Muevo los logs de lugar
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslavandeira committed Jul 20, 2018
1 parent 02741d4 commit 1aaeafa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ def __init__(self, data_json, catalog_id, task, doc_type=Field):
self.elastic = ElasticInstance.get()

def index(self):
IndexMetadataTask.info(self.task,
u'Inicio de la indexación de metadatos de {}'.format(self.catalog_id))

actions = self.scrap_datajson()

self.index_actions(actions)
IndexMetadataTask.info(self.task, u'Fin de la indexación de metadatos de {}'.format(self.catalog_id))

def index_actions(self, actions):
for success, info in parallel_bulk(self.elastic, actions):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,17 @@ def init_index(self):

def run(self):
self.init_index()
IndexMetadataTask.info(self.task, "Inicio la lectura de metadatos")
for node in Node.objects.filter(indexable=True):
try:
data_json = DataJson(node.catalog_url)
IndexMetadataTask.info(self.task,
u'Inicio de la indexación de metadatos de {}'
.format(node.catalog_id))
CatalogMetadataIndexer(data_json, node.catalog_id, self.task, self.doc_type).index()
EnhancedMetaIndexer(node, self.task, self.doc_type).index()
IndexMetadataTask.info(self.task, u'Fin de la indexación de metadatos de {}'
.format(node.catalog_id))

except Exception as e:
IndexMetadataTask.info(self.task,
u'Error en la lectura del catálogo {}: {}'.format(node.catalog_id, e))
Expand Down

0 comments on commit 1aaeafa

Please sign in to comment.