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
e4d739c9
Commit
e4d739c9
authored
Apr 18, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
providers: flush batch on process close
parent
498dd816
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
providers/providers.go
providers/providers.go
+3
-1
No files found.
providers/providers.go
View file @
e4d739c9
...
...
@@ -31,7 +31,7 @@ type ProviderManager struct {
// all non channel fields are meant to be accessed only within
// the run method
providers
*
lru
.
LRU
dstore
ds
.
Datastore
dstore
*
autobatch
.
Datastore
newprovs
chan
*
addProv
getprovs
chan
*
getProv
...
...
@@ -233,6 +233,8 @@ func (pm *ProviderManager) gc() {
func
(
pm
*
ProviderManager
)
run
(
proc
goprocess
.
Process
)
{
tick
:=
time
.
NewTicker
(
pm
.
cleanupInterval
)
defer
tick
.
Stop
()
defer
pm
.
dstore
.
Flush
()
for
{
select
{
case
np
:=
<-
pm
.
newprovs
:
...
...
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