Skip to content

refactor: Refactor rpc celery tasks#830

Open
kesara wants to merge 1 commit intoietf-tools:mainfrom
kesara:refactor/rpc-tasks
Open

refactor: Refactor rpc celery tasks#830
kesara wants to merge 1 commit intoietf-tools:mainfrom
kesara:refactor/rpc-tasks

Conversation

@kesara
Copy link
Member

@kesara kesara commented Jan 28, 2026

No description provided.

Copy link
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mentioned in chat, but so it doesn't get lost... this will need additional work.

  • This refactor does not work with Celery's autodiscover_tasks() mechanism. In a Django project this has each worker execute the equivalent of import <app>.tasks for every <app> in the project. That import is what triggers the task decorators to add their tasks to the task registry and, since tasks.__init__ is empty, nothing happens. It so happens that right now the imports in api.py are being executed in the workers. That makes things work for now, but it's fragile and we really don't want to count on that - it will likely lead to future hard to find issues.
  • Less of a technical issue, but I think we should think about the granularity of submodules. One task per submodule seems too fine. With the three tasks we have now, I'd include the metadata tasks in the publish file as they're logically part of that process.

Given the technical issue and small number of tasks now, I think we should table this refactor for the moment and address it in later work. We should avoid letting tasks.py turn into a dumping ground for unrelated code, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants