mirror of
https://github.com/fluencelabs/redis
synced 2025-03-20 17:40:50 +00:00
proc to retrieve values from INFO properties
This commit is contained in:
parent
4d16bb253c
commit
9cf9e6f197
@ -25,10 +25,16 @@ proc zlistAlikeSort {a b} {
|
|||||||
string compare [lindex $a 1] [lindex $b 1]
|
string compare [lindex $a 1] [lindex $b 1]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Return value for INFO property
|
||||||
|
proc status {r property} {
|
||||||
|
if {[regexp "\r\n$property:(.*?)\r\n" [$r info] _ value]} {
|
||||||
|
set _ $value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
proc waitForBgsave r {
|
proc waitForBgsave r {
|
||||||
while 1 {
|
while 1 {
|
||||||
set i [$r info]
|
if {[status r bgsave_in_progress] eq 1} {
|
||||||
if {[string match {*bgsave_in_progress:1*} $i]} {
|
|
||||||
puts -nonewline "\nWaiting for background save to finish... "
|
puts -nonewline "\nWaiting for background save to finish... "
|
||||||
flush stdout
|
flush stdout
|
||||||
after 1000
|
after 1000
|
||||||
@ -40,8 +46,7 @@ proc waitForBgsave r {
|
|||||||
|
|
||||||
proc waitForBgrewriteaof r {
|
proc waitForBgrewriteaof r {
|
||||||
while 1 {
|
while 1 {
|
||||||
set i [$r info]
|
if {[status r bgrewriteaof_in_progress] eq 1} {
|
||||||
if {[string match {*bgrewriteaof_in_progress:1*} $i]} {
|
|
||||||
puts -nonewline "\nWaiting for background AOF rewrite to finish... "
|
puts -nonewline "\nWaiting for background AOF rewrite to finish... "
|
||||||
flush stdout
|
flush stdout
|
||||||
after 1000
|
after 1000
|
||||||
|
Loading…
x
Reference in New Issue
Block a user