@@ -205,26 +205,26 @@ async function getRevisionInformation(
205
205
return revisionInfo ;
206
206
} catch ( e ) {
207
207
const errorMessage : string = e . message || '' ;
208
-
209
- if ( errorMessage . match ( / 4 0 4 n o t f o u n d | r e s o u r c e n o t f o u n d / i) ) {
210
- if ( secondsPassed > ZEUS_REVISION_INFO_POLLING_MAX ) {
211
- throw new Error (
212
- `Waited for more than ${ ZEUS_REVISION_INFO_POLLING_MAX } seconds, and the revision is still not available. Aborting.`
213
- ) ;
208
+ if ( ! errorMessage . match ( / 4 0 4 n o t f o u n d | r e s o u r c e n o t f o u n d / i) ) {
209
+ if ( spinner . isSpinning ) {
210
+ spinner . fail ( ) ;
214
211
}
215
-
216
- // Update the spinner
217
- const timeString = new Date ( ) . toLocaleString ( ) ;
218
- const waitMessage = `[${ timeString } ] Revision ${ revision } is not yet found in Zeus, retrying in ${ ZEUS_POLLING_INTERVAL } seconds...` ;
219
- spinner . text = waitMessage ;
220
- spinner . start ( ) ;
221
- await sleepAsync ( ZEUS_POLLING_INTERVAL * 1000 ) ;
222
- secondsPassed += ZEUS_POLLING_INTERVAL ;
223
- } else {
224
212
throw e ;
225
213
}
226
- } finally {
227
- spinner . stop ( ) ;
214
+
215
+ if ( secondsPassed > ZEUS_REVISION_INFO_POLLING_MAX ) {
216
+ throw new Error (
217
+ `Waited for more than ${ ZEUS_REVISION_INFO_POLLING_MAX } seconds, and the revision is still not available. Aborting.`
218
+ ) ;
219
+ }
220
+
221
+ // Update the spinner
222
+ const timeString = new Date ( ) . toLocaleString ( ) ;
223
+ const waitMessage = `[${ timeString } ] Revision ${ revision } is not yet found in Zeus, retrying in ${ ZEUS_POLLING_INTERVAL } seconds...` ;
224
+ spinner . text = waitMessage ;
225
+ spinner . start ( ) ;
226
+ await sleepAsync ( ZEUS_POLLING_INTERVAL * 1000 ) ;
227
+ secondsPassed += ZEUS_POLLING_INTERVAL ;
228
228
}
229
229
}
230
230
}
@@ -246,12 +246,16 @@ async function waitForTheBuildToSucceed(
246
246
// Status spinner
247
247
const spinner = ora ( { spinner : 'bouncingBar' } ) as any ;
248
248
let secondsPassed = 0 ;
249
-
249
+ let firstIteration = true ;
250
250
while ( true ) {
251
251
const revisionInfo : RevisionInfo = await getRevisionInformation (
252
252
zeus ,
253
253
revision
254
254
) ;
255
+ if ( firstIteration ) {
256
+ logger . info ( `Revision ${ revision } has been found in Zeus.` ) ;
257
+ firstIteration = false ;
258
+ }
255
259
256
260
const isSuccess = zeus . isRevisionBuiltSuccessfully ( revisionInfo ) ;
257
261
const isFailure = zeus . isRevisionFailed ( revisionInfo ) ;
0 commit comments