Skip to content
Snippets Groups Projects
Commit b019ac1d authored by Alessandro Cerioni's avatar Alessandro Cerioni
Browse files

Bugfix.

parent 850d9f5d
No related branches found
No related tags found
No related merge requests found
...@@ -263,13 +263,15 @@ def process_page( channel, method, properties, body, **kwargs): ...@@ -263,13 +263,15 @@ def process_page( channel, method, properties, body, **kwargs):
# let's look for a WFS ressource to potentially fetch and index... # let's look for a WFS ressource to potentially fetch and index...
wfs_found = False
if 'link' in metadata_record['metadata-fr'].keys(): if 'link' in metadata_record['metadata-fr'].keys():
for link in metadata_record['metadata-fr']['link']: for link in metadata_record['metadata-fr']['link']:
if 'protocol' in link.keys() and link['protocol'] == 'OGC:WFS': if 'protocol' in link.keys() and link['protocol'] == 'OGC:WFS':
logging.debug('EUREKA : found a WFS ressource!') logging.debug('EUREKA : found a WFS ressource!')
# wfs_found = True wfs_found = True
#documents_to_index = [] #documents_to_index = []
# OLD featurePages = getWFS(metadata_record['metadata-fr']['link'][key]) # OLD featurePages = getWFS(metadata_record['metadata-fr']['link'][key])
#featurePages = getWFS(link) # #featurePages = getWFS(link) #
...@@ -283,19 +285,20 @@ def process_page( channel, method, properties, body, **kwargs): ...@@ -283,19 +285,20 @@ def process_page( channel, method, properties, body, **kwargs):
routing_key=kwargs['docs_to_enrich_rk'], routing_key=kwargs['docs_to_enrich_rk'],
body=the_body, body=the_body,
properties=pika.BasicProperties(delivery_mode = 2) ) properties=pika.BasicProperties(delivery_mode = 2) )
break
else:
meta_version = metadata_record.copy() # including metadata ONLY if not wfs_found:
meta_version['uuid'] = metadata_record['metadata-fr']['geonet:info']['uuid'] + '.meta'
msg = {'header': { "index" : { "_index" : dest_index, "_type" : "_doc" } }, 'body': meta_version} meta_version = metadata_record.copy() # including metadata ONLY
the_body = msgpack.packb(msg, use_bin_type=True) meta_version['uuid'] = metadata_record['metadata-fr']['geonet:info']['uuid'] + '.meta'
channel.basic_publish( exchange=kwargs['exchange'], msg = {'header': { "index" : { "_index" : dest_index, "_type" : "_doc" } }, 'body': meta_version}
routing_key=kwargs['docs_to_index_rk'], the_body = msgpack.packb(msg, use_bin_type=True)
body=the_body,
properties=pika.BasicProperties(delivery_mode = 2) ) channel.basic_publish( exchange=kwargs['exchange'],
routing_key=kwargs['docs_to_index_rk'],
body=the_body,
properties=pika.BasicProperties(delivery_mode = 2) )
channel.basic_ack(delivery_tag = method.delivery_tag) channel.basic_ack(delivery_tag = method.delivery_tag)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment