Skip to content

Commit ab3bb06

Browse files
authored
fix(taskworker): Make activity task compatible with taskworker (#91292)
Also throw an exception if any task is created without a taskworker config.
1 parent 0dcd555 commit ab3bb06

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/sentry/tasks/activity.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from sentry.silo.base import SiloMode
44
from sentry.tasks.base import instrumented_task
5+
from sentry.taskworker.config import TaskworkerConfig
6+
from sentry.taskworker.namespaces import notifications_tasks
57
from sentry.utils.sdk import bind_organization_context
68

79
logger = logging.getLogger(__name__)
@@ -26,8 +28,11 @@ def get_activity_notifiers(project):
2628
name="sentry.tasks.activity.send_activity_notifications",
2729
queue="activity.notify",
2830
silo_mode=SiloMode.REGION,
31+
taskworker_config=TaskworkerConfig(
32+
namespace=notifications_tasks,
33+
),
2934
)
30-
def send_activity_notifications(activity_id):
35+
def send_activity_notifications(activity_id: int) -> None:
3136
from sentry.models.activity import Activity
3237
from sentry.models.organization import Organization
3338

0 commit comments

Comments
 (0)