Flask server responding with 204 when using background process

I am using background process for a callback to run. When the multiple time same callback is triggered the previous jobs are failing and 204 http code is returned. I believe the jobs should run in queue and when particular job is completed the response should come back. Instead the newly created job is running and previous jobs are failing.