File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/build/src/homebrew Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,19 @@ import type { GithubRepo } from '@mongodb-js/devtools-github-repo';
77 * what leads to receiving an EPIPE error from the OS, indicating the connection has already been closed.
88 * In such cases, retrying the request can help establish a new, functional connection.
99 */
10- async function getFileWithRetry (
10+ async function getFormulaFromRepositoryWithRetry (
1111 homebrewCore : GithubRepo ,
1212 remainingRetries = 3
1313) {
1414 try {
1515 return await homebrewCore . getFileContent ( 'Formula/m/mongosh.rb' , 'master' ) ;
1616 } catch ( error : any ) {
1717 if ( error . message . includes ( 'EPIPE' ) && remainingRetries > 0 ) {
18- return await getFileWithRetry ( homebrewCore , remainingRetries - 1 ) ;
18+ console . error ( error ) ;
19+ return await getFormulaFromRepositoryWithRetry (
20+ homebrewCore ,
21+ remainingRetries - 1
22+ ) ;
1923 } else {
2024 throw error ;
2125 }
@@ -27,7 +31,7 @@ export async function generateUpdatedFormula(
2731 homebrewCore : GithubRepo ,
2832 isDryRun : boolean
2933) : Promise < string | null > {
30- const currentFormula = await getFileWithRetry ( homebrewCore ) ;
34+ const currentFormula = await getFormulaFromRepositoryWithRetry ( homebrewCore ) ;
3135
3236 const urlMatch = / u r l " ( [ ^ " ] + ) " / g. exec ( currentFormula . content ) ;
3337 const shaMatch = / s h a 2 5 6 " ( [ ^ " ] + ) " / g. exec ( currentFormula . content ) ;
You can’t perform that action at this time.
0 commit comments