Skip to content

Commit

Permalink
feat: optionally ignore perc. defaulted not to ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
wphyojpl committed Dec 12, 2024
1 parent 76c3d54 commit b200262
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cumulus_lambda_functions/lib/uds_db/granules_db_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __init__(self):
base_url=os.getenv('ES_URL'),
port=int(os.getenv('ES_PORT', '443'))
)
self.__include_percolator = os.getenv('INCLUDE_PERCOLATOR', 'TRUE') == 'TRUE'
# self.__default_fields = {
# "granule_id": {"type": "keyword"},
# "collection_id": {"type": "keyword"},
Expand Down Expand Up @@ -130,6 +131,8 @@ def create_new_index(self, tenant, tenant_venue, es_mapping: dict):
self.__es.create_alias(new_index_name, read_alias_name)
self.__es.swap_index_for_alias(write_alias_name, current_index_name, new_index_name)

if not self.__include_percolator:
return
write_perc_alias_name = f'{DBConstants.granules_write_alias_prefix}_{tenant}_{tenant_venue}_perc'.lower().strip()
read_perc_alias_name = f'{DBConstants.granules_read_alias_prefix}_{tenant}_{tenant_venue}_perc'.lower().strip()
current_perc_alias = self.__es.get_alias(write_perc_alias_name)
Expand Down

0 comments on commit b200262

Please sign in to comment.