79449300

Date: 2025-02-18 18:46:58
Score: 0.5
Natty:
Report link

I found the problem!

I wasn't acking the task when it finished

It wasn't something that gave an answer, so I did't get the result. I only checked that it was on rabbitmq like this:

async_result = available_tasks[task_name].apply_async(args=[data], kwargs=kwargs)
data = {'job_id': async_result.id, 'state': async_result.state}
code = 200
status = True
message = ''
return response(status, code, data, message)

But I shoulded use something like this:

async_result = available_tasks[task_name].apply_async(args=[data], kwargs=kwargs)
data = {'job_id': async_result.id, 'state': async_result.state, 'job_result': async_result.get()}
code = 200
status = True
message = ''
return response(status, code, data, message)

If I wouldn't use the get function rabbitmq would wait for the acknowledgement and disconect. That was the origin of the problem

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Miguel Robledo