This PR improves the retry logic to better map to how cosmos db behaves.
Currently it will sleep ever increasing amounts of time until it hits the max retry limit. This doesn't really map well to how cosmos behaves, as usually it's not that the previous attempt didn't wait long enough, it's that the limit was simply hit again after inserting more documents.
Now the retry logic will pause for a constant time after each attempt, and the max rate is configurable via environment variable (with the option to have no limit).
This PR improves the retry logic to better map to how cosmos db behaves.
Currently it will sleep ever increasing amounts of time until it hits the max retry limit. This doesn't really map well to how cosmos behaves, as usually it's not that the previous attempt didn't wait long enough, it's that the limit was simply hit again after inserting more documents.
Now the retry logic will pause for a constant time after each attempt, and the max rate is configurable via environment variable (with the option to have no limit).