oliviergauthier / gradle-appcenter-plugin

This gradle plugin allow you to upload each build variant of your android application to separate AppCenter Apps.
MIT License
85 stars 45 forks source link

Fix: Allow getUpload to take longer than just 60 seconds #82

Closed Rolf-Smit closed 2 years ago

Rolf-Smit commented 2 years ago

This potentially fixes: #81.

It seems AppCenter nowadays takes longer to process releases. This plugin currently just waits for 60 seconds, and during this time it makes 60 attempts. However the official AppCenter CLI waits forever, and uses a 2 second timeout: https://github.com/microsoft/appcenter-cli/blob/9974d6d925c040a7ca2cc3a814ba292d9fbcab73/src/commands/distribute/release.ts#L443

Obviously I don't think this plugin should wait forever, instead I made it so that it waits for about 15 minutes in total instead of 60 seconds it is currently waiting. I also added an increasing timeout between attempts, to avoid having too many API calls. If we would put this on a graph it would look like this:

image

So worst case scenario (when it reaches attempt 25) it waits for about 3 minutes before trying again. I believe that should be reasonable.

I also noticed the official AppCenter CLI stops attempting if the back-end returns "error", so I also implemented that.

I hope we can quickly get this as a hot-fix, let me know what you think. Maybe it would be wise to make these values configurable in the future?

Rolf-Smit commented 2 years ago

@oliviergauthier can you please look at this? Thanks!