Skip to content

Commit 3611fcf

Browse files
jaer-tsuntamilmani1989
authored andcommitted
Reset tb connections (#308)
* Limiting the size of our buffered payload to ~2MB * Clearing/resetting connections slice in telemetry buffer.
1 parent 4be2f92 commit 3611fcf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

telemetry/telemetrybuffer.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,15 @@ func (tb *TelemetryBuffer) Close() {
239239
tb.listener = nil
240240
}
241241

242-
for index, conn := range tb.connections {
242+
for _, conn := range tb.connections {
243243
if conn != nil {
244244
telemetryLogger.Printf("connection close")
245245
conn.Close()
246-
remove(tb.connections, index)
247246
}
248247
}
248+
249+
tb.connections = nil
250+
tb.connections = make([]net.Conn, 0)
249251
}
250252

251253
// sendToHost - send payload to host

0 commit comments

Comments
 (0)