mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-03 13:00:37 +08:00
check mode with use func node.OnlineMode() bool
This commit is contained in:

committed by
Juan Batiz-Benet

parent
772f657fcd
commit
8b6931cb02
@ -31,7 +31,7 @@ var diagCmd = &cmds.Command{
|
|||||||
Run: func(res cmds.Response, req cmds.Request) {
|
Run: func(res cmds.Response, req cmds.Request) {
|
||||||
n := req.Context().Node
|
n := req.Context().Node
|
||||||
|
|
||||||
if n.Diagnostics == nil {
|
if !n.Online() {
|
||||||
res.SetError(errors.New("Cannot run diagnostic in offline mode!"), cmds.ErrNormal)
|
res.SetError(errors.New("Cannot run diagnostic in offline mode!"), cmds.ErrNormal)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user