Skip to content

Commit

Permalink
feat(debug): fix big bug era
Browse files Browse the repository at this point in the history
  • Loading branch information
ashquarky committed Jan 2, 2025
1 parent 4765018 commit 8ec1d52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func main() {
func selfTest() {
globals.Logger.Info("Self-testing...")
var errors = 0
var seenPids map[uint64]struct{}
seenPids := make(map[uint64]struct{})
// apparently we hold a lock all the way thru this
globals.SecureEndpoint.Connections.Each(func(key string, pc *nex2.PRUDPConnection) bool {
if pc.PID() == nil || pc.PID().Value() == 0 {
Expand All @@ -51,7 +51,7 @@ func selfTest() {
var found = false
globals.SecureServer.Connections.Each(func(key string, sc *nex2.SocketConnection) bool {
return sc.Connections.Each(func(key uint8, pc2 *nex2.PRUDPConnection) bool {
if pc2 == pc {
if pc2.ID == pc.ID {
if found {
globals.Logger.Warningf("Duplicate SocketConnection: %v %#v", key, pc)
errors++
Expand All @@ -68,7 +68,7 @@ func selfTest() {
}
return false
})
globals.Logger.Infof("Self-test finished with %v errors", errors)
globals.Logger.Infof("Self-test finished with %v errors - %v connections", errors, globals.SecureEndpoint.Connections.Size())
}
func startSelfTesting() {
for range time.Tick(10 * time.Second) {
Expand Down

0 comments on commit 8ec1d52

Please sign in to comment.