I am using Celery for asynchronous task processing in my Django application. Some of my tasks involve handling large amounts of data passed as task_kwargs. However, I have noticed that when the task_kwargs are too large, the TaskResult shows the data with an ellipsis (…), indicating that the full data is not being stored or displayed.
Here’s an example of what my task arguments look like:
task_kwargs = {
'period': {'ydpedid': 50, 'period': 2, 'year': 2024},
'sector': '1',
'routes': [
{'yddiaid': 1, 'code': '0102', 'descr': '0102'},
{'yddiaid': 5, 'code': '0104', 'descr': '0104'},
# Many more routes...
],
'user_id': 12345
}
When I check the TaskResult, it shows the task_kwargs like this:
"{'period': {'ydpedid': 50, 'period': 2, 'year': 2024}, 'sector': '1', 'routes': [{'yddiaid': 1, 'code': '0102', 'descr': '0102'} #more routes , ...}]}"
the total length of task_kwargs is 1031
I am looking for a way to ensure that the entire task_kwargs is stored and visible in the TaskResult without truncation. Is there a specific configuration option I am missing or a recommended approach to handle large task_kwargs in Celery?