Commit c516b74c by George Babey

Fix config when analytics db name differs from config name

In https://github.com/edx/configuration/pull/4443/files I mistakenly changed
the ANALYTICS_DATABASE to the ANALYTICS_API_REPORTS_DB_NAME. In fact this
config refers to the database config identifer in the DATABASES dictionary.

This worked fine in sandboxes where both the config and the db are named
'reports', however when those configs differ, such as on staging, the health
check would fail as it tries to connect to the reporting database. This PR
fixes that change by setting this value back to 'reports'
parent b5d27fe3
...@@ -94,6 +94,9 @@ ANALYTICS_API_DATABASES: ...@@ -94,6 +94,9 @@ ANALYTICS_API_DATABASES:
PORT: '{{ ANALYTICS_API_REPORTS_PORT }}' PORT: '{{ ANALYTICS_API_REPORTS_PORT }}'
OPTIONS: "{{ ANALYTICS_API_REPORTS_MYSQL_OPTIONS }}" OPTIONS: "{{ ANALYTICS_API_REPORTS_MYSQL_OPTIONS }}"
# This CONFIG_ALIAS needs to match the key in the above DATABASES config
ANALYTICS_DB_CONFIG_ALIAS: 'reports'
ANALYTICS_API_ELASTICSEARCH_LEARNERS_HOST: 'localhost' ANALYTICS_API_ELASTICSEARCH_LEARNERS_HOST: 'localhost'
ANALYTICS_API_ELASTICSEARCH_LEARNERS_INDEX: 'roster_1_2' ANALYTICS_API_ELASTICSEARCH_LEARNERS_INDEX: 'roster_1_2'
ANALYTICS_API_ELASTICSEARCH_LEARNERS_UPDATE_INDEX: 'index_updates' ANALYTICS_API_ELASTICSEARCH_LEARNERS_UPDATE_INDEX: 'index_updates'
...@@ -144,7 +147,7 @@ analytics_api_service_config_overrides: ...@@ -144,7 +147,7 @@ analytics_api_service_config_overrides:
LMS_BASE_URL: "{{ ANALYTICS_API_LMS_BASE_URL | default('http://127.0.0.1:8000') }}" LMS_BASE_URL: "{{ ANALYTICS_API_LMS_BASE_URL | default('http://127.0.0.1:8000') }}"
# db config # db config
ANALYTICS_DATABASE: '{{ ANALYTICS_API_REPORTS_DB_NAME }}' ANALYTICS_DATABASE: '{{ ANALYTICS_DB_CONFIG_ALIAS }}'
DATABASES: '{{ ANALYTICS_API_DATABASES }}' DATABASES: '{{ ANALYTICS_API_DATABASES }}'
ELASTICSEARCH_LEARNERS_HOST: '{{ ANALYTICS_API_ELASTICSEARCH_LEARNERS_HOST }}' ELASTICSEARCH_LEARNERS_HOST: '{{ ANALYTICS_API_ELASTICSEARCH_LEARNERS_HOST }}'
ELASTICSEARCH_LEARNERS_INDEX: '{{ ANALYTICS_API_ELASTICSEARCH_LEARNERS_INDEX }}' ELASTICSEARCH_LEARNERS_INDEX: '{{ ANALYTICS_API_ELASTICSEARCH_LEARNERS_INDEX }}'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment