Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to store arguments in SQL alchemy backed which are passed to celery task in flask app

i am working on flask app which initiate large no of tasks in background using celery , and i am using Redis as message broker queue and SQL alchemy as celery back-end.

By default, i can see "Results" are stored in back-end in "results" column for celery_taskmeta table , but i would like to store args as well which was passed to task .

And i would like to retrieve them as well in future . Is there any way i can store them in my current back-end.

Thanks

like image 933
Rohit Kurdukar Avatar asked Oct 30 '25 04:10

Rohit Kurdukar


1 Answers

You can use this parameter in your settings =>

result_extended = True

Enables extended task result attributes (name, args, kwargs, worker, retries, queue, delivery_info) to be written to backend.

Check out the link for explanation : https://docs.celeryproject.org/en/stable/userguide/configuration.html#result-extended

like image 71
Sowjanya R Bhat Avatar answered Nov 01 '25 07:11

Sowjanya R Bhat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!