File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -102,15 +102,16 @@ func (r *RtRefreshManager) Close() error {
102102//
103103// The returned channel will block until the refresh finishes, then yield the
104104// error and close. The channel is buffered and safe to ignore.
105- // FIXME: this can block. Ideally, we'd return a channel without blocking.
106- // https://github.com/libp2p/go-libp2p-kad-dht/issues/609
107105func (r * RtRefreshManager ) Refresh (force bool ) <- chan error {
108106 resp := make (chan error , 1 )
109- select {
110- case r .triggerRefresh <- & triggerRefreshReq {respCh : resp , forceCplRefresh : force }:
111- case <- r .ctx .Done ():
112- resp <- r .ctx .Err ()
113- }
107+ go func () {
108+ select {
109+ case r .triggerRefresh <- & triggerRefreshReq {respCh : resp , forceCplRefresh : force }:
110+ case <- r .ctx .Done ():
111+ resp <- r .ctx .Err ()
112+ }
113+ }()
114+
114115 return resp
115116}
116117
You can’t perform that action at this time.
0 commit comments