mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
cluster.tcl: fix redis links leak in refresh_nodes_map.
This commit is contained in:
parent
cdf2271c5b
commit
27ca133d35
@ -64,7 +64,6 @@ proc ::redis_cluster::__method__refresh_nodes_map {id} {
|
||||
set r [redis $start_host $start_port]
|
||||
set nodes_descr [$r cluster nodes]
|
||||
$r close
|
||||
puts $e
|
||||
} e]} {
|
||||
if {$r ne {}} {catch {$r close}}
|
||||
incr idx
|
||||
@ -123,6 +122,13 @@ proc ::redis_cluster::__method__refresh_nodes_map {id} {
|
||||
lappend ::redis_cluster::startup_nodes($id) $addr
|
||||
}
|
||||
|
||||
# Close all the existing links in the old nodes map, and set the new
|
||||
# map as current.
|
||||
foreach n $::redis_cluster::nodes($id) {
|
||||
catch {
|
||||
[dict get $n link] close
|
||||
}
|
||||
}
|
||||
set ::redis_cluster::nodes($id) $nodes
|
||||
|
||||
# Populates the slots -> nodes map.
|
||||
|
Loading…
Reference in New Issue
Block a user