1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-26 23:53:19 +08:00

close channels and allow daemon to shutdown

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
Jeromy
2015-06-19 22:39:33 -07:00
parent 7d254aef20
commit 6211ee46c2

View File

@ -300,6 +300,7 @@ func serveHTTPApi(req cmds.Request) (error, <-chan error) {
errc := make(chan error) errc := make(chan error)
go func() { go func() {
errc <- corehttp.Serve(node, apiLis.NetListener(), opts...) errc <- corehttp.Serve(node, apiLis.NetListener(), opts...)
close(errc)
}() }()
return nil, errc return nil, errc
} }
@ -355,6 +356,7 @@ func serveHTTPGateway(req cmds.Request) (error, <-chan error) {
errc := make(chan error) errc := make(chan error)
go func() { go func() {
errc <- corehttp.Serve(node, gwLis.NetListener(), opts...) errc <- corehttp.Serve(node, gwLis.NetListener(), opts...)
close(errc)
}() }()
return nil, errc return nil, errc
} }