Revert use of celery task for Discord notifications
diff --git a/backend/oasst_backend/prompt_repository.py b/backend/oasst_backend/prompt_repository.py
index 1ce0cab569..d5f1a477aa 100644
--- a/backend/oasst_backend/prompt_repository.py
+++ b/backend/oasst_backend/prompt_repository.py
@@ -30,8 +30,8 @@
 from oasst_backend.models.payload_column_type import PayloadContainer
 from oasst_backend.task_repository import TaskRepository, validate_frontend_message_id
 from oasst_backend.user_repository import UserRepository
+from oasst_backend.utils import discord
 from oasst_backend.utils.database_utils import CommitMode, db_lang_to_postgres_ts_lang, managed_tx_method
-from oasst_backend.utils.discord import send_new_report_message
 from oasst_shared.exceptions import OasstError, OasstErrorCode
 from oasst_shared.schemas import protocol as protocol_schema
 from oasst_shared.schemas.protocol import SystemStats
@@ -595,7 +595,7 @@ def store_text_labels(self, text_labels: protocol_schema.TextLabels) -> tuple[Te
                         message_id, protocol_schema.EmojiOp.add, protocol_schema.EmojiCode.red_flag
                     )
 
-                    send_new_report_message.delay(message=message, label_text=text_labels.text, user_id=self.user_id)
+                    discord.send_new_report_message(message=message, label_text=text_labels.text, user_id=self.user_id)
 
                 # update existing record for repeated updates (same user no task associated)
                 existing_text_label = self.fetch_non_task_text_labels(message_id, self.user_id)
diff --git a/backend/oasst_backend/utils/discord.py b/backend/oasst_backend/utils/discord.py
index 464ff6ae7a..3f8f5f62b6 100644
--- a/backend/oasst_backend/utils/discord.py
+++ b/backend/oasst_backend/utils/discord.py
@@ -2,18 +2,15 @@
 
 import requests
 from loguru import logger
-from oasst_backend.celery_worker import app as celery_app
 from oasst_backend.config import settings
 from oasst_backend.models.message import Message
 
 ROOT_ENDPOINT = "https://discord.com/api/v10"
 
 
-@celery_app.task(name="send_new_report_message")
 def send_new_report_message(message: Message, label_text: str, user_id: UUID):
     """
     Send a message to the Discord channel when a new message is flagged.
-    Note: this is a Celery task.
 
     Args:
         message (Message): the flagged message
diff --git a/backend/update_message_attributes.py b/backend/update_message_attributes.py
index 0290e029d1..8e09c92ab3 100644
--- a/backend/update_message_attributes.py
+++ b/backend/update_message_attributes.py
@@ -2,7 +2,7 @@
 
 from loguru import logger
 from oasst_backend.models import ApiClient, Message
-from oasst_backend.scheduled_tasks import check_toxicity, hf_feature_extraction
+from oasst_backend.scheduled_tasks import hf_feature_extraction, toxicity
 from oasst_backend.utils.database_utils import default_session_factory
 from sqlmodel import text
 
@@ -71,7 +71,7 @@ def find_and_update_toxicity(message_ids):
                     text = result.payload.payload.text
                     api_client = session.query(ApiClient).filter(ApiClient.id == api_client_id).first()
                     if api_client is not None and text is not None:
-                        check_toxicity(text=text, message_id=message_id, api_client=api_client.__dict__)
+                        toxicity(text=text, message_id=message_id, api_client=api_client.__dict__)
                         # to not get rate limited from HF
                         time.sleep(10)
     except Exception as e:

Should fix #3504 