Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: improve init lms task time by using settings instead of waffle flags #937

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tutoraspects/patches/openedx-common-settings
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
2 changes: 1 addition & 1 deletion tutoraspects/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 0 additions & 10 deletions tutoraspects/templates/aspects/jobs/init/lms/init-lms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}