Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
close reuse-connections before deleting them
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Aug 11, 2019
1 parent b454058 commit a68dcbb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions reuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ func (r *reuse) runGarbageCollector() {
r.mutex.Lock()
for key, conn := range r.global {
if conn.ShouldGarbageCollect(now) {
conn.Close()
delete(r.global, key)
}
}
for ukey, conns := range r.unicast {
for key, conn := range conns {
if conn.ShouldGarbageCollect(now) {
conn.Close()
delete(conns, key)
}
}
Expand Down

0 comments on commit a68dcbb

Please sign in to comment.