Closed iamtekson closed 1 year ago
I could be wrong, but from a quick skim, I think you can probably just manually create a TaskResult instance with the task-id; store_results
seems to be using get_or_create
. You would want to be a bit careful about any race conditions doing that might bring along though; perhaps using a lock?
https://github.com/celery/django-celery-results/issues/130#issuecomment-583319233
The solution provided by this comment worked perfectly for me!
I implemented the
celery
withdjango_celery_results
. It is working fine. I am calling the function with the.delay()
method and it is giving me thetask_id
as well. But the problem is theTaskResult
instance is created only after the task is done. I want this feature to overwrite or create theTaskResult
instance just after the.delay()
function is called. Is there any way that I can create theinstance
instantly after calling.delay()
?Any help will be highly appreciated. Thank you!