HTTP 499 is the that client has closed the connection. Its likely the client has timeout out the operation. So sounds like you would just need to increase the timeout threshold of the consuming client.
I have found using a backgroundservice helps particularly with long running operations, you can off load to that as well.
Also if this is an azure function I would also check these limits.
Default timeout The default timeout for the consumption plan is five minutes, with a maximum of 10 minutes The default timeout for the premium plan is 30 minutes, with an unlimited maximum