Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-kad-dht
Commits
e9b5f37b
Commit
e9b5f37b
authored
Dec 23, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dht_test: better bootstrapping logging
parent
2b40651f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
dht_test.go
dht_test.go
+5
-3
No files found.
dht_test.go
View file @
e9b5f37b
...
...
@@ -94,17 +94,19 @@ func connect(t *testing.T, ctx context.Context, a, b *IpfsDHT) {
func
bootstrap
(
t
*
testing
.
T
,
ctx
context
.
Context
,
dhts
[]
*
IpfsDHT
)
{
// try multiple rounds...
rounds
:=
5
rounds
:=
1
for
i
:=
0
;
i
<
rounds
;
i
++
{
fmt
.
Printf
(
"bootstrapping round %d/%d
\n
"
,
i
,
rounds
)
var
wg
sync
.
WaitGroup
for
_
,
dht
:=
range
dhts
{
wg
.
Add
(
1
)
go
func
()
{
go
func
(
i
int
)
{
defer
wg
.
Done
()
<-
time
.
After
(
time
.
Duration
(
i
)
*
time
.
Millisecond
)
// stagger them to avoid overwhelming
fmt
.
Printf
(
"bootstrapping round %d/%d -- %s
\n
"
,
i
,
rounds
,
dht
.
self
)
dht
.
Bootstrap
(
ctx
)
}()
}(
i
)
}
wg
.
Wait
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment