mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-11 01:03:11 +00:00
remote tracer: wait a second to accumulate batches
This commit is contained in:
parent
57ea27eef7
commit
2fc5518a00
@ -178,11 +178,14 @@ func (t *RemoteTracer) doWrite() {
|
||||
for {
|
||||
_, ok := <-t.ch
|
||||
|
||||
// nil out the buffer to gc events
|
||||
// nil out the buffer to gc events when swapping buffers
|
||||
for i := range buf {
|
||||
buf[i] = nil
|
||||
}
|
||||
|
||||
// wait a bit to accumulate a batch
|
||||
time.Sleep(time.Second)
|
||||
|
||||
t.mx.Lock()
|
||||
tmp := t.buf
|
||||
t.buf = buf[:0]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user