Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
feat: Add event listener for course publish
Browse files Browse the repository at this point in the history
Creates the edx-platform plugin plumbing, adds some new requirements, maps the appropriate Django Signal to push course structure to ClickHouse.
  • Loading branch information
bmtcril committed May 1, 2023
1 parent dee8304 commit b178733
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion event_sink_clickhouse/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def plugin_settings(settings):
"""
settings.EVENT_SINK_CLICKHOUSE_BACKEND_CONFIG = {
# URL to a running ClickHouse server's HTTP interface. ex: https://foo.openedx.org:8443/ or
# http://foo.openedx.org:8123/
# http://foo.openedx.org:8123/ . Note that we only support the ClickHouse HTTP interface
# to avoid pulling in more dependencies to the platrform than necessary.
"url": "http://clickhouse:8123",
"username": "changeme",
"password": "changeme",
Expand Down
3 changes: 1 addition & 2 deletions event_sink_clickhouse/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ def receive_course_publish(sender, course_key, **kwargs): # pylint: disable=unu
# import here, because signal is registered at startup, but items in tasks are not yet able to be loaded
from .tasks import dump_course_to_clickhouse # pylint: disable=import-outside-toplevel

course_key_str = str(course_key)
dump_course_to_clickhouse.delay(course_key_str)
dump_course_to_clickhouse.delay(str(course_key))
4 changes: 2 additions & 2 deletions event_sink_clickhouse/sinks/course_published.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def serialize_course(self, course_id):
course_id: CourseKey of the course we want to serialize
Returns:
nodes: a csv of nodes for the course
relationships: a csv of relationships between nodes
nodes: a list of dicts representing xblocks for the course
relationships: a list of dicts representing relationships between nodes
"""
# Import is placed here to avoid model import at project startup.
from xmodule.modulestore.django import modulestore # pylint: disable=import-outside-toplevel,import-error
Expand Down

0 comments on commit b178733

Please sign in to comment.