Skip to content

Commit

Permalink
test: add logs for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
mzz2017 committed Sep 8, 2024
1 parent c002177 commit 04f57d0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions component/outbound/dialer/connectivity_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"strings"
"sync"
"time"
"unsafe"

"github.com/daeuniverse/dae/common"

Expand Down Expand Up @@ -452,6 +453,18 @@ func (d *Dialer) aliveBackground() {
}
}
}()
var unused int
for _, opt := range CheckOpts {
if len(d.mustGetCollection(opt.networkType).AliveDialerSetSet) == 0 {
unused++
}
}
if unused == len(CheckOpts) {
d.Log.WithField("dialer", d.Property().Name).
WithField("p", unsafe.Pointer(d)).
Traceln("cleaned up due to unused")
return
}
var wg sync.WaitGroup
for range d.checkCh {
for _, opt := range CheckOpts {
Expand Down
4 changes: 4 additions & 0 deletions component/outbound/dialer/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"
"sync"
"time"
"unsafe"

"github.com/daeuniverse/dae/common"
"github.com/daeuniverse/dae/config"
Expand Down Expand Up @@ -97,6 +98,9 @@ func NewDialer(dialer netproxy.Dialer, option *GlobalOption, iOption InstanceOpt
ctx: ctx,
cancel: cancel,
}
option.Log.WithField("dialer", d.Property().Name).
WithField("p", unsafe.Pointer(d)).
Traceln("NewDialer")
return d
}

Expand Down

0 comments on commit 04f57d0

Please sign in to comment.