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

feat: call set_code_owner_attribute_from_module directly in send_task #130

Merged
merged 7 commits into from
Oct 27, 2021
Merged
Changes from 3 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
9 changes: 7 additions & 2 deletions eventtracking/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

from celery.utils.log import get_task_logger
from celery import shared_task
from edx_django_utils.monitoring import set_code_owner_attribute
from celery.signals import task_prerun
from edx_django_utils.monitoring import set_code_owner_attribute_from_module
from eventtracking.tracker import get_tracker
from eventtracking.processors.exceptions import (
NoBackendEnabled,
Expand All @@ -18,8 +19,12 @@
COUNTDOWN = 30


@task_prerun.connect(sender='eventtracking.tasks.send_event')
def add_code_owner_attribute(task=None, **kwargs):
set_code_owner_attribute_from_module(task.__module__)
robrap marked this conversation as resolved.
Show resolved Hide resolved


@shared_task(bind=True)
@set_code_owner_attribute
def send_event(self, backend_name, processed_event):
"""
Send event to configured top-level backend asynchronously.
Expand Down