(maxAttemptsCount, act, onRetry)
| 1293 | } |
| 1294 | |
| 1295 | async function attemptAction (maxAttemptsCount, act, onRetry) { |
| 1296 | let error = null; |
| 1297 | for (let i = 0; i < maxAttemptsCount; i++) { |
| 1298 | if (i > 0 && onRetry) { |
| 1299 | onRetry(error, i + 1); |
| 1300 | await sleep(i * 1000); |
| 1301 | } |
| 1302 | try { |
| 1303 | const result = await new Promise(act); |
| 1304 | return result; |
| 1305 | } catch (e) { |
| 1306 | error = e; |
| 1307 | } |
| 1308 | } |
| 1309 | throw error; |
| 1310 | } |
| 1311 | |
| 1312 | function prepareForPublishing (task, build, onDone) { |
| 1313 | if (LOCAL || !build.files || !build.variants) { |
no test coverage detected