File tree Expand file tree Collapse file tree 1 file changed +17
-21
lines changed Expand file tree Collapse file tree 1 file changed +17
-21
lines changed Original file line number Diff line number Diff line change @@ -41,27 +41,23 @@ module.exports = async (options) => {
41
41
42
42
console . info ( '🗂️ Loading registry index from' , options . registry ) // eslint-disable-line no-console
43
43
44
- const mirror = await request ( Object . assign ( { } , options . request , {
45
- uri : options . registry ,
46
- json : true
47
- } ) )
48
-
49
- console . info ( '☎️ Dialling registry mirror' , mirror . ipfs . addresses . join ( ',' ) ) // eslint-disable-line no-console
50
-
51
- await timeout (
52
- Promise . race (
53
- mirror . ipfs . addresses . map ( addr => {
54
- return ipfs . api . swarm . connect ( mirror . ipfs . addresses [ 0 ] )
55
- } )
56
- ) ,
57
- options . registryConnectTimeout
58
- )
59
- . then ( ( ) => {
60
- console . info ( '📱️ Connected to registry' ) // eslint-disable-line no-console
61
- } )
62
- . catch ( ( ) => {
63
-
64
- } )
44
+ try {
45
+ const mirror = await request ( Object . assign ( { } , options . request , {
46
+ uri : options . registry ,
47
+ json : true
48
+ } ) )
49
+
50
+ console . info ( '☎️ Dialling registry mirror' , mirror . ipfs . addresses . join ( ',' ) ) // eslint-disable-line no-console
51
+
52
+ await timeout (
53
+ ipfs . api . swarm . connect ( mirror . ipfs . addresses [ 0 ] ) ,
54
+ options . registryConnectTimeout
55
+ )
56
+
57
+ console . info ( '📱️ Connected to registry' ) // eslint-disable-line no-console
58
+ } catch ( error ) {
59
+ console . info ( '📴 Not connected to registry' ) // eslint-disable-line no-console
60
+ }
65
61
66
62
console . info ( '👩🚀 Starting local proxy' ) // eslint-disable-line no-console
67
63
You can’t perform that action at this time.
0 commit comments