mirror of
https://github.com/libp2p/go-libp2p-resource-manager.git
synced 2025-01-27 12:50:07 +08:00
Don't add reporter twice
This commit is contained in:
parent
ac716c1bf3
commit
662c094201
2
trace.go
2
trace.go
@ -47,7 +47,7 @@ func WithTrace(path string) Option {
|
||||
func WithTraceReporter(reporter TraceReporter) Option {
|
||||
return func(r *resourceManager) error {
|
||||
if r.trace == nil {
|
||||
r.trace = &trace{reporters: []TraceReporter{reporter}}
|
||||
r.trace = &trace{}
|
||||
}
|
||||
r.trace.reporters = append(r.trace.reporters, reporter)
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user