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-routing
Commits
172cd15e
Commit
172cd15e
authored
Sep 08, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use new methods from goprocess/context, remove thirdparty/waitable
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
d21309d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
dht/ext_test.go
dht/ext_test.go
+1
-1
dht/query.go
dht/query.go
+2
-2
No files found.
dht/ext_test.go
View file @
172cd15e
...
...
@@ -51,7 +51,7 @@ func TestGetFailures(t *testing.T) {
err
=
merr
[
0
]
}
if
err
!=
context
.
DeadlineExceeded
&&
err
!=
context
.
Canceled
{
if
err
.
Error
()
!=
"process closing"
{
t
.
Fatal
(
"Got different error than we expected"
,
err
)
}
}
else
{
...
...
dht/query.go
View file @
172cd15e
...
...
@@ -85,7 +85,7 @@ type dhtQueryRunner struct {
func
newQueryRunner
(
q
*
dhtQuery
)
*
dhtQueryRunner
{
proc
:=
process
.
WithParent
(
process
.
Background
())
ctx
:=
ctxproc
.
WithProcess
Closing
(
c
ontext
.
Background
(),
proc
)
ctx
:=
ctxproc
.
On
Closing
C
ontext
(
proc
)
return
&
dhtQueryRunner
{
query
:
q
,
peersToQuery
:
queue
.
NewChanQueue
(
ctx
,
queue
.
NewXORDistancePQ
(
q
.
key
)),
...
...
@@ -210,7 +210,7 @@ func (r *dhtQueryRunner) queryPeer(proc process.Process, p peer.ID) {
// ok let's do this!
// create a context from our proc.
ctx
:=
ctxproc
.
WithProcess
Closing
(
c
ontext
.
Background
(),
proc
)
ctx
:=
ctxproc
.
On
Closing
C
ontext
(
proc
)
// make sure we do this when we exit
defer
func
()
{
...
...
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