0

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?

3
  • Cannot test it right now, but looks like it's an answers for your question github.com/celery/celery/issues/2724#issuecomment-164013509 stackoverflow.com/questions/67795156/… Commented Jun 19, 2024 at 12:03
  • Likely it does pass the kwargs correctly, it simply does not show the data. Commented Jun 19, 2024 at 12:05
  • @willeM_VanOnsem it simply does not show the data I dont know if you mean that the data isn't being displayed or retrieved from the database as expected. However, in database the data is being strored with ellipsis Commented Jun 19, 2024 at 13:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.