Open nico2am opened 4 weeks ago
Hi @nico2am it looks like your task explicitly says to not store and ignore the results
@app.task(bind=True, ignore_result=True)
...
Could you please check if results are stored when removing ignore_result
or setting it to False?
Hello,
I check and I donn't have ignore_result, this is my configuration:
celery.py
app.conf.update(
# Task settings
task_track_started=True,
task_time_limit=30 * 60,
task_ignore_result=False,
result_extended=True,
# Serialization settings
accept_content=['application/json'],
task_serializer='json',
result_serializer='json',
# Worker settings
worker_send_task_events=True, # Same as -E option
worker_prefetch_multiplier=1, # For better task distribution
)
# Load task modules from all registered Django apps.
app.autodiscover_tasks()
tasks/tasks.py
from celery import shared_task
@shared_task
def send_mail(email_id):
email = Email.objects.get(id=email_id)
Celery task results are not stored in the Django database
Environment
Description
Tasks are visible in Flower but are not being saved to the database task results table. The issue persists despite using the recommended configuration from the documentation and various solutions found in other issues and forums.
Current Configuration
Django Settings
Celery Configuration (celery.py)
Attempted Solution
I've implemented a signal handler to manually track task completion and save results:
The signal handler successfully creates records in the database, but the default Celery result backend still isn't saving results automatically as expected.
Questions
Additional Information
Any help or guidance would be greatly appreciated!