File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import glob from 'glob'
1111import util from '../lib/util.js'
1212import crx from '../lib/crx.js'
1313
14- const downloadExtension = async ( config ) => {
14+ const downloadExtensionInternal = async ( config ) => {
1515 const buildPath = path . join ( 'build' , config . name )
1616 const download = path . join ( buildPath , 'download' )
1717 const unpacked = path . join ( buildPath , 'unpacked' )
@@ -59,6 +59,21 @@ const downloadExtension = async (config) => {
5959 }
6060}
6161
62+ const downloadExtension = async ( config ) => {
63+ const maxAttempts = 3
64+ for ( let attempt = 1 ; attempt <= maxAttempts ; ++ attempt ) {
65+ try {
66+ return await downloadExtensionInternal ( config )
67+ } catch ( error ) {
68+ if ( attempt < maxAttempts ) {
69+ await new Promise ( resolve => setTimeout ( resolve , 5000 * attempt ) )
70+ } else {
71+ throw error
72+ }
73+ }
74+ }
75+ }
76+
6277const getExtensionConfig = ( extensionName ) => {
6378 return path . join ( 'manifests' , extensionName , 'config.json' )
6479}
You can’t perform that action at this time.
0 commit comments