@@ -236,8 +236,8 @@ For now you can open \`./${appDirRelative}\` in your favorite IDE like VS Code.
236236 description,
237237 } )
238238 const { headAppDefinitionPresignedUrl, getAppDefinitionPresignedUrl } = output . data . data
239- await sleep ( 20000 ) // It takes at least 20s to generate a definition; chill before polling
240- await this . pollS3ObjectExistence ( { headObjectPresignedUrl : headAppDefinitionPresignedUrl , timeout : 120_000 } )
239+ await sleep ( 30_000 ) // It takes at least 30s to generate a definition; chill before polling
240+ await this . pollS3ObjectExistence ( { headObjectPresignedUrl : headAppDefinitionPresignedUrl , interval : 3000 , timeout : 120_000 } )
241241 const response = await axios . get ( getAppDefinitionPresignedUrl , { responseType : 'arraybuffer' } )
242242 const zip = new AdmZip ( response . data )
243243 const overwrite = true
@@ -317,17 +317,17 @@ For now you can open \`./${appDirRelative}\` in your favorite IDE like VS Code.
317317
318318 async pollS3ObjectExistence ( {
319319 headObjectPresignedUrl,
320+ interval,
320321 timeout,
321322 startTime = Date . now ( ) ,
322323 attempt = 1 ,
323324 } : {
324325 headObjectPresignedUrl : string
326+ interval : number
325327 timeout : number
326328 startTime ?: number
327329 attempt ?: number
328330 } ) {
329- const interval = 3000
330-
331331 // If timeout is reached, stop polling
332332 if ( Date . now ( ) - startTime >= timeout ) {
333333 this . error ( 'Timed out waiting for app to generate.' , {
@@ -357,7 +357,7 @@ For now you can open \`./${appDirRelative}\` in your favorite IDE like VS Code.
357357 // Wait before polling again
358358 await sleep ( interval )
359359
360- await this . pollS3ObjectExistence ( { headObjectPresignedUrl, startTime, attempt : attempt + 1 , timeout } )
360+ await this . pollS3ObjectExistence ( { headObjectPresignedUrl, startTime, attempt : attempt + 1 , interval , timeout } )
361361 return
362362 }
363363 }
@@ -379,12 +379,12 @@ For now you can open \`./${appDirRelative}\` in your favorite IDE like VS Code.
379379 appDir : string
380380 } ) : Promise < undefined > {
381381 ux . action . start ( '🏗️ Generating project' )
382- await this . pollS3ObjectExistence ( { headObjectPresignedUrl : headOutputPresignedUrl , timeout : 30_000 } )
382+ await this . pollS3ObjectExistence ( { headObjectPresignedUrl : headOutputPresignedUrl , interval : 1000 , timeout : 30_000 } )
383383 ux . action . stop ( '✅' )
384384 ux . action . start ( '⬇️📦 Downloading project' )
385385 const response = await axios . get ( getOutputPresignedUrl , { responseType : 'arraybuffer' } )
386386 const zip = new AdmZip ( response . data )
387- const overwrite = false
387+ const overwrite = true
388388 zip . extractAllTo ( appDir , overwrite )
389389 ux . action . stop ( '✅' )
390390 }
0 commit comments