Skip to content

Commit

Permalink
fix: circumvent messagebroker-db selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightknight3000 committed Aug 16, 2024
1 parent c3ac5c5 commit 90d2716
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ def get_project_data_source(keycloak_token, project_id, hub_adapter_service_name
return asyncio.run(call_sources(client, project_id))


def get_element_by_substring(data: list[str], substring: str) -> str:
def get_element_by_substring(data: list[str], substring: str) -> str: # TODO: Better solution for this
"""
Get the smallest element in a list that contains a substring
:param data:
:param substring:
:return:
"""
matching_elements = [element for element in data if substring in element]
matching_elements = [element for element in data if (substring in element) and ('-db-' not in element)] # TODO: '-db-'- hack for messagebroker
return min(matching_elements, key=len) if matching_elements else None


Expand Down

0 comments on commit 90d2716

Please sign in to comment.