Updated code for worker to consume the queue and update the tasks object for each transaction