Skip to content

tasks.py — Celery Task for Add-or-Update #43

@whisper67265

Description

@whisper67265

Problem

Heavy add-or-update work must run outside the web request. A Celery task should run the same logic as before, using the correct user context.

Acceptance Criteria

  • A Celery task boost_add_or_update_task is registered on Weblate’s Celery app.
  • The task accepts organization, add_or_update map, version, optional extensions, and user_id.
  • The task loads the User, builds an AuthenticatedHttpRequest with that user, and runs BoostComponentService per language.
  • The task returns a per-language results dict; failures surface as task failures (exceptions propagate).

Implementation Notes

  • Use weblate.utils.celery.app and trail=False on @app.task if you want to match the current pattern.
  • Reuse BoostComponentService.process_all for each (lang_code, submodules) pair.

References

  • src/boost_weblate/endpoint/tasks.py

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions