Skip to content

Commit

Permalink
fix: bug retrieving the Meilisearch API key UID (first time only)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald authored and yusuf-musleh committed Apr 21, 2024
1 parent 4fe4e18 commit 32d7d09
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions openedx/core/djangoapps/content/search/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,9 @@ def _get_meili_api_key_uid():
Helper method to get the UID of the API key we're using for Meilisearch
"""
global _MEILI_API_KEY_UID # pylint: disable=global-statement

if _MEILI_API_KEY_UID is not None:
return _MEILI_API_KEY_UID

_MEILI_API_KEY_UID = _get_meilisearch_client().get_key(settings.MEILISEARCH_API_KEY).uid
if _MEILI_API_KEY_UID is None:
_MEILI_API_KEY_UID = _get_meilisearch_client().get_key(settings.MEILISEARCH_API_KEY).uid
return _MEILI_API_KEY_UID


def _wait_for_meili_task(info: TaskInfo) -> None:
Expand Down

0 comments on commit 32d7d09

Please sign in to comment.