mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 10:49:24 +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) {
|
||||
n := req.Context().Node
|
||||
|
||||
if n.Diagnostics == nil {
|
||||
if !n.Online() {
|
||||
res.SetError(errors.New("Cannot run diagnostic in offline mode!"), cmds.ErrNormal)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user