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
e6a4d6a3
Commit
e6a4d6a3
authored
Feb 27, 2020
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(query): cancel the context when the query finishes
parent
30ba05e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
query.go
query.go
+4
-0
No files found.
query.go
View file @
e6a4d6a3
...
...
@@ -125,6 +125,10 @@ func newQueryRunner(q *dhtQuery) *dhtQueryRunner {
}
func
(
r
*
dhtQueryRunner
)
Run
(
ctx
context
.
Context
,
peers
[]
peer
.
ID
)
(
*
dhtQueryResult
,
error
)
{
// Make sure to clean everything up when we return from this function.
ctx
,
cancel
:=
context
.
WithCancel
(
ctx
)
defer
cancel
()
r
.
log
=
logger
r
.
runCtx
=
ctx
...
...
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