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
dms3
go-dms3
Commits
1493c9d8
Commit
1493c9d8
authored
Jan 18, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dht/bootstrap: logging
parent
ec848c48
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
routing/dht/dht_bootstrap.go
routing/dht/dht_bootstrap.go
+11
-1
No files found.
routing/dht/dht_bootstrap.go
View file @
1493c9d8
...
...
@@ -42,6 +42,10 @@ const DefaultBootstrapQueries = 1
// queries
const
DefaultBootstrapPeriod
=
time
.
Duration
(
10
*
time
.
Second
)
// DefaultBootstrapTimeout specifies how long to wait for a bootstrap query
// to run.
const
DefaultBootstrapTimeout
=
time
.
Duration
(
10
*
time
.
Second
)
// Bootstrap runs bootstrapping once, then calls SignalBootstrap with default
// parameters: DefaultBootstrapQueries and DefaultBootstrapPeriod. This allows
// the user to catch an error off the bat if the connections are faulty. It also
...
...
@@ -76,10 +80,10 @@ func (dht *IpfsDHT) BootstrapOnSignal(queries int, signal <-chan time.Time) (gop
}
proc
:=
goprocess
.
Go
(
func
(
worker
goprocess
.
Process
)
{
defer
log
.
Debug
(
"dht bootstrapper shutting down"
)
for
{
select
{
case
<-
worker
.
Closing
()
:
log
.
Debug
(
"dht bootstrapper shutting down"
)
return
case
<-
signal
:
...
...
@@ -118,6 +122,12 @@ func (dht *IpfsDHT) BootstrapOnSignal(queries int, signal <-chan time.Time) (gop
// runBootstrap builds up list of peers by requesting random peer IDs
func
(
dht
*
IpfsDHT
)
runBootstrap
(
ctx
context
.
Context
,
queries
int
)
error
{
bslog
:=
func
(
msg
string
)
{
log
.
Debugf
(
"DHT %s dhtRunBootstrap %s -- routing table size: %d"
,
dht
.
self
,
msg
,
dht
.
routingTable
.
Size
())
}
bslog
(
"start"
)
defer
bslog
(
"end"
)
defer
log
.
EventBegin
(
ctx
,
"dhtRunBootstrap"
)
.
Done
()
var
merr
u
.
MultiErr
...
...
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