cds-snc / tracker

Check whether a Government of Canada domain is adhering to best security practices.
Other
12 stars 9 forks source link

Improve retry #42

Closed buckley-w-david closed 6 years ago

buckley-w-david commented 6 years ago

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).