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.
15 lines
297 B
Python
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()
|