Commit e6a4d6a3 authored by Steven Allen's avatar Steven Allen

fix(query): cancel the context when the query finishes

parent 30ba05e2
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment