Celery
- Keep tasks small and idempotent — a task should be safe to retry on failure. Always set `task_acks_late=True` and `task_reject_on_worker_lost=True` for reliable delivery. Use `bind=True` on tasks to access `self.retry()`.
Celery
- Keep tasks small and idempotent — a task should be safe to retry on failure. Always set `task_acks_late=True` and `task_reject_on_worker_lost=True` for reliable delivery. Use `bind=True` on tasks to access `self.retry()`.
- Set `task_time_limit` and `task_soft_time_limit` on every task to prevent worker starvation. Use `chain()`, `group()`, `chord()` for composing workflows — avoid calling tasks inside tasks synchronously. Store task results only when needed (`ignore_result=True` by default). Use separate queues for different priority levels and task types.