我的redis数据库具有大量键,因此,当我启动代码时,如果我进行信息持久化(在redis CLI上),它将为我提供以下信息,正在加载:1表示redis尚未准备好进行连接,而加载:0则表示重新启动并运行并准备建立连接。
loading:1
rdb_changes_since_last_save:1024
rdb_bgsave_in_progress:0
rdb_last_save_time:1530558451
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:-1
rdb_current_bgsave_time_sec:-1
rdb_last_cow_size:0
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok
aof_last_cow_size:0
我与redis建立连接的代码如下:
var DefaultPool = NewPool("redis", 6379)
/*NewPool - create a new redis pool accessible at the given address */
func NewPool(host string, port int) *redis.Pool {
var address string
if os.Getenv("DOCKER") != "" {
address = fmt.Sprintf("%v:6379", host)
} else {
address = fmt.Sprintf("127.0.0.1:%v", port)
}
return &redis.Pool{
MaxIdle: 80,
MaxActive: 1000, // max number of connections
Dial: func() (redis.Conn, error) {
c, err := redis.Dial("tcp", address)
if err != nil {
panic(err.Error())
}
return c, err
},
}
}
如何不断检查加载值是否为0。
答案 0 :(得分:0)
获取信息:
I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector)
检查加载字段:
I=function(a){return Ðçü����Ðçü��������������������k‡������������@þõ����8èü������������ðçü�����@������ðçü������������,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector)