mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-03 04:37:30 +08:00
Merge pull request #3723 from ipfs/fix/daemon/late-gw
daemon: move gateway start to latter
This commit is contained in:
@ -377,17 +377,6 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// construct http gateway - if it is set in the config
|
|
||||||
var gwErrc <-chan error
|
|
||||||
if len(cfg.Addresses.Gateway) > 0 {
|
|
||||||
var err error
|
|
||||||
err, gwErrc = serveHTTPGateway(req)
|
|
||||||
if err != nil {
|
|
||||||
res.SetError(err, cmds.ErrNormal)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// construct fuse mountpoints - if the user provided the --mount flag
|
// construct fuse mountpoints - if the user provided the --mount flag
|
||||||
mount, _, err := req.Option(mountKwd).Bool()
|
mount, _, err := req.Option(mountKwd).Bool()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -413,6 +402,17 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// construct http gateway - if it is set in the config
|
||||||
|
var gwErrc <-chan error
|
||||||
|
if len(cfg.Addresses.Gateway) > 0 {
|
||||||
|
var err error
|
||||||
|
err, gwErrc = serveHTTPGateway(req)
|
||||||
|
if err != nil {
|
||||||
|
res.SetError(err, cmds.ErrNormal)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// initialize metrics collector
|
// initialize metrics collector
|
||||||
prometheus.MustRegister(&corehttp.IpfsNodeCollector{Node: node})
|
prometheus.MustRegister(&corehttp.IpfsNodeCollector{Node: node})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user