File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 19
19
},
20
20
"devDependencies" : {
21
21
"aegir" : " ^20.4.1" ,
22
- "async-iterator-all" : " ^1.0.0" ,
23
22
"chai" : " ^4.2.0" ,
24
23
"cids" : " ^0.7.1" ,
25
24
"go-ipfs-dep" : " ~0.4.22" ,
26
25
"ipfsd-ctl" : " ~0.47.4" ,
27
26
"peer-id" : " ~0.13.5"
28
27
},
29
28
"dependencies" : {
29
+ "async-iterator-all" : " ^1.0.0" ,
30
30
"debug" : " ^4.1.1" ,
31
31
"ipfs-http-client" : " ^40.0.1" ,
32
32
"multiaddr" : " ^7.2.1" ,
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
+ const debug = require ( 'debug' )
4
+
3
5
const dht = require ( 'ipfs-http-client/src/dht' )
4
6
const refs = require ( 'ipfs-http-client/src/refs' )
5
7
const getEndpointConfig = require ( 'ipfs-http-client/src/get-endpoint-config' )
8
+
6
9
const { default : PQueue } = require ( 'p-queue' )
7
- const debug = require ( 'debug ' )
10
+ const all = require ( 'async-iterator-all ' )
8
11
9
12
const log = debug ( 'libp2p-delegated-content-routing' )
10
13
log . error = debug ( 'libp2p-delegated-content-routing:error' )
@@ -89,10 +92,10 @@ class DelegatedContentRouting {
89
92
async provide ( key ) {
90
93
const keyString = key . toBaseEncodedString ( )
91
94
log ( 'provide starts: ' + keyString )
92
- await this . _httpQueueRefs . add ( ( ) =>
93
- this . refs ( keyString , { recursive : false } )
95
+ const results = await this . _httpQueueRefs . add ( ( ) =>
96
+ all ( this . refs ( keyString , { recursive : false } ) )
94
97
)
95
- log ( 'provide finished: ' + keyString )
98
+ log ( 'provide finished: ' , keyString , results )
96
99
}
97
100
}
98
101
You can’t perform that action at this time.
0 commit comments