Skip to content
Snippets Groups Projects
Commit d5f4fd71 authored by Jake Taylor's avatar Jake Taylor
Browse files

added manager print on timer

parent 3ff93e9a
Branches
Tags
1 merge request!11Release
...@@ -170,17 +170,6 @@ listen: ...@@ -170,17 +170,6 @@ listen:
grpc.KeepaliveEnforcementPolicy(KaEnforcement)) grpc.KeepaliveEnforcementPolicy(KaEnforcement))
} }
// Intermittantly print manager connection information
go func() {
ticker := time.NewTicker(60 * time.Second)
for {
select {
case _ = <-ticker.C:
jww.INFO.Printf(pc.Manager.String())
}
}
}()
return pc, lis, nil return pc, lis, nil
} }
......
...@@ -16,6 +16,7 @@ import ( ...@@ -16,6 +16,7 @@ import (
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
"sync" "sync"
"testing" "testing"
"time"
) )
// The Manager object provides thread-safe access // The Manager object provides thread-safe access
...@@ -103,6 +104,19 @@ func (m *Manager) DisconnectAll() { ...@@ -103,6 +104,19 @@ func (m *Manager) DisconnectAll() {
} }
} }
// StartConnectionReport begins intermittently printing connection information
func (m *Manager) StartConnectionReport() {
go func() {
ticker := time.NewTicker(60 * time.Second)
for {
select {
case _ = <-ticker.C:
jww.INFO.Printf(m.String())
}
}
}()
}
// Implements Stringer for debug printing // Implements Stringer for debug printing
func (m *Manager) String() string { func (m *Manager) String() string {
var result bytes.Buffer var result bytes.Buffer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment