From 69b4bea486113ce02c52c64d3fe6791671dfcbac Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Wed, 11 Sep 2024 09:54:18 -0500 Subject: [PATCH 1/2] perf: improve init lms tasks time by using settings instead of waffle flags --- tutoraspects/patches/openedx-common-settings | 7 +++++++ .../templates/aspects/jobs/init/lms/init-lms.sh | 10 ---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tutoraspects/patches/openedx-common-settings b/tutoraspects/patches/openedx-common-settings index 79c1416a3..b0ed3b591 100644 --- a/tutoraspects/patches/openedx-common-settings +++ b/tutoraspects/patches/openedx-common-settings @@ -59,3 +59,10 @@ EVENT_BUS_PRODUCER_CONFIG.update( if not "openedx_events" in INSTALLED_APPS: INSTALLED_APPS.append("openedx_events") {% endif %} + + +{% for model in EVENT_SINK_MODELS_ENABLED %} +EVENT_SINK_CLICKHOUSE_{{model.upper()}}_ENABLED = True{% endfor %} +{% if ASPECTS_ENABLE_PII %}# User PII models +{% for model in EVENT_SINK_PII_MODELS %}EVENT_SINK_CLICKHOUSE_{{model.upper()}}_ENABLED = True +{% endfor %}{% endif %} diff --git a/tutoraspects/templates/aspects/jobs/init/lms/init-lms.sh b/tutoraspects/templates/aspects/jobs/init/lms/init-lms.sh index 69cf40d80..7e323948d 100644 --- a/tutoraspects/templates/aspects/jobs/init/lms/init-lms.sh +++ b/tutoraspects/templates/aspects/jobs/init/lms/init-lms.sh @@ -36,13 +36,3 @@ EOF ./manage.py lms manage_user tutor-contrib-aspects aspects@axim --unusable-password ./manage.py lms populate_model -f /tmp/erb_config.json -u tutor-contrib-aspects {% endif %} - -{% for model in EVENT_SINK_MODELS_ENABLED %} -(./manage.py lms waffle_flag --list | grep event_sink_clickhouse.{{model}}.enabled) || ./manage.py lms waffle_flag --create event_sink_clickhouse.{{model}}.enabled --everyone -{% endfor %} - -{% if ASPECTS_ENABLE_PII %} - {% for model in EVENT_SINK_PII_MODELS %} -(./manage.py lms waffle_flag --list | grep event_sink_clickhouse.{{model}}.enabled) || ./manage.py lms waffle_flag --create event_sink_clickhouse.{{model}}.enabled --everyone - {% endfor %} -{% endif %} From 7100cdc79cbe3cf23e5d68c3fce48bc56cd60516 Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Wed, 11 Sep 2024 10:06:22 -0500 Subject: [PATCH 2/2] fix: enable course_enrollment sink --- tutoraspects/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutoraspects/plugin.py b/tutoraspects/plugin.py index d3668f492..5e8fd94e2 100644 --- a/tutoraspects/plugin.py +++ b/tutoraspects/plugin.py @@ -40,7 +40,7 @@ ("DOCKER_IMAGE_VECTOR", "timberio/vector:0.30.0-alpine"), ( "EVENT_SINK_MODELS_ENABLED", - ["course_overviews", "tag", "taxonomy", "object_tag"], + ["course_overviews", "tag", "taxonomy", "object_tag", "course_enrollment"], ), ( "EVENT_SINK_PII_MODELS",