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
b8eb083e
Commit
b8eb083e
authored
Nov 05, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(bootstrap): rename scanInterval to refreshTicker
parent
76f388b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
dht_bootstrap.go
dht_bootstrap.go
+4
-4
No files found.
dht_bootstrap.go
View file @
b8eb083e
...
...
@@ -45,20 +45,20 @@ func (dht *IpfsDHT) startRefreshing() error {
dht
.
proc
.
Go
(
func
(
proc
process
.
Process
)
{
ctx
:=
processctx
.
OnClosingContext
(
proc
)
scanInterval
:=
time
.
NewTicker
(
dht
.
rtRefreshPeriod
)
defer
scanInterval
.
Stop
()
refreshTicker
:=
time
.
NewTicker
(
dht
.
rtRefreshPeriod
)
defer
refreshTicker
.
Stop
()
// refresh if option is set
if
dht
.
autoRefresh
{
dht
.
doRefresh
(
ctx
)
}
else
{
// disable the "auto-refresh" ticker so that no more ticks are sent to this channel
scanInterval
.
Stop
()
refreshTicker
.
Stop
()
}
for
{
select
{
case
<-
scanInterval
.
C
:
case
<-
refreshTicker
.
C
:
case
<-
dht
.
triggerRtRefresh
:
logger
.
Infof
(
"triggering a refresh: RT has %d peers"
,
dht
.
routingTable
.
Size
())
case
<-
ctx
.
Done
()
:
...
...
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