We are calling an API within ActiveBatch with the following PowerShell.
$refreshResponse = Invoke-RestMethod -Uri $psApiUri -Headers $authHeaders -Method 'GET'
When this is used to call the dev environment version of the endpoint it works fine. However in production after five minutes we are seeing a second, duplicate call happening against the API. It happens every time in production after five minutes, there is nothing in the output that indicates the second call happened.
The only difference spotted so far between the two environments is that Prod is load balanced. What could potentially cause this to happen in only one of our environments.
It might not be related but also in prod only, after 10 minutes the call fails with the following error. Many of the runs are 8-9 minutes so we don't get the failure, but still the double call.
Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a receive.