microsoft / StoreBroker

A PowerShell module that leverages the Windows Store Submission API to allow easy automation of application submissions to the Windows Store. The master branch is stable and the v2 branch is under active development.
Other
97 stars 40 forks source link

Add retry logic when Invoke-WebRequest throws timed out exception #221

Open joseartrivera opened 3 years ago

joseartrivera commented 3 years ago

Calls to Invoke-SBRestMethod will retry the request if we receive a 202 response, but does not retry if an exception of "The operation has timed out." gets thrown. It is not clear why this exception gets thrown, could be intermittent connection issues?

It looks like we handle this exception when running Start-SubmissionMonitor, so we can handle it in a similar way in Invoke-SBRestMethod and trigger a retry.

https://github.com/microsoft/StoreBroker/blob/abd0007755fe662773913efcd9b7865e77cfd33d/StoreBroker/StoreIngestionApi.psm1#L1401