schon/evibes/celery.py
fureunoir 4c7b40b899 Features: 1) Add orjson serializer and integrate it into Celery configuration for enhanced performance and compatibility; 2) Introduce configurable task settings such as soft and hard time limits, task tracking, and event serialization for better control and observability.
Fixes: 1) Update worker entrypoints to adjust prefetch multiplier and memory/task limits for optimized resource usage.

Extra: 1) Refactor Celery settings into a dedicated file for improved organization and maintainability; 2) Adjust Docker entrypoints to align with updated task configurations; 3) Register `orjson` serializer in a separate module for cleaner code structure.
2026-01-04 18:37:00 +03:00

15 lines
297 B
Python

import os
from celery import Celery
from evibes.celery_serializers import register_orjson
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "evibes.settings")
app = Celery("evibes")
register_orjson()
app.config_from_object("django.conf:settings", namespace="CELERY")
app.autodiscover_tasks()