mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-28 13:57:52 +08:00
actually put diagCmd into the super command so it can be run
This commit is contained in:
parent
d5f0476c1c
commit
77cec59083
@ -59,6 +59,7 @@ Use "ipfs help <command>" for more information about a command.
|
||||
cmdIpfsRun,
|
||||
cmdIpfsName,
|
||||
cmdIpfsBootstrap,
|
||||
cmdIpfsDiag,
|
||||
},
|
||||
Flag: *flag.NewFlagSet("ipfs", flag.ExitOnError),
|
||||
}
|
||||
|
||||
@ -105,6 +105,10 @@ func (p *Peer) GetLatency() (out time.Duration) {
|
||||
// Yep, should be EWMA or something. (-jbenet)
|
||||
func (p *Peer) SetLatency(laten time.Duration) {
|
||||
p.Lock()
|
||||
p.latency = laten
|
||||
if p.latency == 0 {
|
||||
p.latency = laten
|
||||
} else {
|
||||
p.latency = ((p.latency * 9) + laten) / 10
|
||||
}
|
||||
p.Unlock()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user