Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 25 additions & 27 deletions src/hubmap_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,13 @@ def enqueue_reindex(self, entity_id, reindex_queue, priority):
)
collection_associations = []
upload_associations = []
previous_revision_ids = []
next_revision_ids = []
neo4j_collection_ids = []
neo4j_upload_ids = []
neo4j_ancestor_ids = []
neo4j_descendant_ids = []

if entity['entity_type'] in ['Collection', 'Epicollection']:
collection = self.get_collection_doc(entity_id=entity_id)
if 'datasets' in collection:
Expand All @@ -722,38 +729,29 @@ def enqueue_reindex(self, entity_id, reindex_queue, priority):
if 'associated_publication' in collection and collection['associated_publication']:
logger.info(f"Enqueueing associated_publication for {entity['entity_type']} {entity_id}")
collection_associations.append(collection['associated_publication'])

logger.info(f"Finished executing enqueue_reindex() for {entity['entity_type']} of uuid: {entity_id}")
return job_id

if entity['entity_type'] == 'Upload':
elif entity['entity_type'] == 'Upload':
if 'datasets' in entity:
logger.info(f"Enqueueing {len(entity['datasets'])} datasets for Upload {entity_id}")
for dataset in entity['datasets']:
upload_associations.append(dataset['uuid'])
logger.info(f"Finished executing enqueue_reindex() for Upload of uuid: {entity_id}")
return job_id

logger.info(f"Calculating related entities for {entity_id}")

neo4j_ancestor_ids = self.call_entity_api(
entity_id=entity_id,
endpoint_base='ancestors',
endpoint_suffix=None,
url_property='uuid'
)

neo4j_descendant_ids = self.call_entity_api(
entity_id=entity_id,
endpoint_base='descendants',
endpoint_suffix=None,
url_property='uuid'
)

previous_revision_ids = []
next_revision_ids = []
neo4j_collection_ids = []
neo4j_upload_ids = []

else:
logger.info(f"Calculating related entities for {entity_id}")

neo4j_ancestor_ids = self.call_entity_api(
entity_id=entity_id,
endpoint_base='ancestors',
endpoint_suffix=None,
url_property='uuid'
)

neo4j_descendant_ids = self.call_entity_api(
entity_id=entity_id,
endpoint_base='descendants',
endpoint_suffix=None,
url_property='uuid'
)

if entity['entity_type'] in ['Dataset', 'Publication']:
previous_revision_ids = self.call_entity_api(
Expand Down
10 changes: 6 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
config['ONTOLOGY_API_BASE_URL'] = app.config['ONTOLOGY_API_BASE_URL'].strip('/')
config['DEBUG_MODE'] = app.config['DEBUG_MODE']
config['JOB_QUEUE_MODE'] = app.config['JOB_QUEUE_MODE']
config['REDIS_HOST'] = app.config['REDIS_HOST']
config['REDIS_PORT'] = app.config['REDIS_PORT']
config['REDIS_DB'] = app.config['REDIS_DB']
config['REDIS_PASSWORD'] = app.config['REDIS_PASSWORD']
if config.get('JOB_QUEUE_MODE') == True:
config['REDIS_HOST'] = app.config.get('REDIS_HOST')
config['REDIS_PORT'] = app.config.get('REDIS_PORT')
config['REDIS_DB'] = app.config.get('REDIS_DB')
config['REDIS_PASSWORD'] = app.config.get('REDIS_PASSWORD')


if not config['ONTOLOGY_API_BASE_URL']:
raise Exception(f"Unable retrieve ontology information using"
Expand Down
2 changes: 1 addition & 1 deletion src/search-adaptor
Submodule search-adaptor updated 2 files
+1 −1 VERSION
+29 −7 src/app.py