Reset tb connections (#308)
* Limiting the size of our buffered payload to ~2MB * Clearing/resetting connections slice in telemetry buffer.
This commit is contained in:
Родитель
4be2f9288a
Коммит
3611fcf783
|
@ -239,13 +239,15 @@ func (tb *TelemetryBuffer) Close() {
|
|||
tb.listener = nil
|
||||
}
|
||||
|
||||
for index, conn := range tb.connections {
|
||||
for _, conn := range tb.connections {
|
||||
if conn != nil {
|
||||
telemetryLogger.Printf("connection close")
|
||||
conn.Close()
|
||||
remove(tb.connections, index)
|
||||
}
|
||||
}
|
||||
|
||||
tb.connections = nil
|
||||
tb.connections = make([]net.Conn, 0)
|
||||
}
|
||||
|
||||
// sendToHost - send payload to host
|
||||
|
|
Загрузка…
Ссылка в новой задаче