Commit 285a2764 authored by Steven Allen's avatar Steven Allen

wait for daemon to completely stop, even on error

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent a44f0d25
......@@ -24,6 +24,7 @@ import (
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
migrate "github.com/ipfs/go-ipfs/repo/fsrepo/migrations"
"github.com/hashicorp/go-multierror"
"github.com/ipfs/go-ipfs-cmdkit"
cmds "github.com/ipfs/go-ipfs-cmds"
mprome "github.com/ipfs/go-metrics-prometheus"
......@@ -421,13 +422,14 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
// collect long-running errors and block for shutdown
// TODO(cryptix): our fuse currently doesnt follow this pattern for graceful shutdown
var errs error
for err := range merge(apiErrc, gwErrc, gcErrc) {
if err != nil {
return err
errs = multierror.Append(errs, err)
}
}
return nil
return errs
}
// serveHTTPApi collects options, creates listener, prints status message and starts serving requests
......
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