feat: add name parameter to shared task for archiving room messages#928
Open
kallilsouza wants to merge 1 commit intomainfrom
Open
feat: add name parameter to shared task for archiving room messages#928kallilsouza wants to merge 1 commit intomainfrom
kallilsouza wants to merge 1 commit intomainfrom
Conversation
MarcusviniciusLsantos
approved these changes
Mar 27, 2026
Sandro-Meireles
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Added an explicit
nameparameter to thestart_archive_rooms_messagesCelery task decorator, changing it from@shared_task(queue="archive-chats")to@shared_task(name="start_archive_rooms_messages", queue="archive-chats").Why
The task was registered in
CELERY_BEAT_SCHEDULEwith the short name"start_archive_rooms_messages", but without an explicitnamein the decorator, Celery auto-generates the task name using the full module path (chats.apps.archive_chats.tasks.start_archive_rooms_messages). This mismatch caused Celery Beat to send messages with an unrecognized task name, resulting inNotRegisterederrors on workers and the task never executing in production.This fix aligns with the existing pattern used by the
process_pending_reportstask, which already setsname="process_pending_reports"explicitly.Sequence diagram
sequenceDiagram participant Beat as Celery Beat participant Broker as Redis Broker participant Worker as Celery Worker Note over Beat,Worker: Before fix Beat->>Broker: Send task "start_archive_rooms_messages" Broker->>Worker: Deliver task Worker--xWorker: NotRegistered (only knows "chats.apps.archive_chats.tasks.start_archive_rooms_messages") Note over Beat,Worker: After fix Beat->>Broker: Send task "start_archive_rooms_messages" Broker->>Worker: Deliver task Worker->>Worker: Match task by explicit name="start_archive_rooms_messages" Worker->>Worker: Execute start_archive_rooms_messages() Worker->>Broker: Dispatch archive_room_messages subtasks (queue: archive-chats)