func RedisGet(r redis.AsyncClient, k string) (value []byte, timeout bool) { f, rerr := r.Get(k) if rerr != nil { log.Fatal("RedisGet failed: ", rerr) } value, rerr, timeout = f.TryGet(REDIS_GET_TIMEOUT) if rerr != nil { log.Fatal("RedisGet failed: ", rerr) } if timeout { loadtimeout++ log.Println("load timeout! count: ", loadtimeout) return } return }
func RedisSet(r redis.AsyncClient, k string, val []byte) (timeout bool) { f, rerr := r.Set(key, val) if rerr != nil { log.Fatal("RedisSet failed: ", rerr) } _, rerr, timeout = f.TryGet(REDIS_SET_TIMEOUT) if rerr != nil { log.Fatal("RedisSet failed: ", rerr) } if timeout { savetimeout++ log.Println("save timeout! count: ", savetimeout) return } return }