mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
GO-2828: fix comments
Signed-off-by: AnastasiaShemyakinskaya <shem98a@mail.ru>
This commit is contained in:
parent
f85006c0b8
commit
c0f3ea733a
3 changed files with 6 additions and 7 deletions
|
@ -334,9 +334,12 @@ func (p *peer) Close() (err error) {
|
|||
|
||||
func (p *peer) ProvideStat() *Stat {
|
||||
protoVersion, _ := CtxProtoVersion(p.Context())
|
||||
p.mu.Lock()
|
||||
subConnectionsCount := len(p.active)
|
||||
p.mu.Unlock()
|
||||
return &Stat{
|
||||
PeerId: p.id,
|
||||
SubConnections: len(p.subConnRelease),
|
||||
SubConnections: subConnectionsCount,
|
||||
Created: p.created,
|
||||
Version: protoVersion,
|
||||
}
|
||||
|
|
|
@ -142,10 +142,6 @@ func (p *pool) pick(ctx context.Context, source ocache.OCache, id string) (peer.
|
|||
return nil, fmt.Errorf("failed to pick connection with peer: peer not found")
|
||||
}
|
||||
|
||||
func (p *pool) AddStatProvider() {
|
||||
p.statService.AddProvider(p)
|
||||
}
|
||||
|
||||
func (p *pool) ProvideStat() any {
|
||||
peerStats := make([]*peer.Stat, 0)
|
||||
p.outgoing.ForEach(func(v ocache.Object) (isContinue bool) {
|
||||
|
|
|
@ -69,8 +69,8 @@ func (p *poolService) Init(a *app.App) (err error) {
|
|||
if !ok {
|
||||
comp = debugstat.NewNoOp()
|
||||
}
|
||||
p.pool.statService = comp
|
||||
p.pool.AddStatProvider()
|
||||
p.statService = comp
|
||||
p.statService.AddProvider(p)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue