| 395 | } |
| 396 | |
| 397 | const redis_result* redis_command::run(size_t nchild /* = 0 */, |
| 398 | int* timeout /* = NULL */) |
| 399 | { |
| 400 | if (pipeline_ != NULL) { |
| 401 | assert(pipe_msg_); // build_request() must have been called first. |
| 402 | pipe_msg_->set_option(nchild, timeout); |
| 403 | pipe_msg_->set(dbuf_); |
| 404 | result_ = pipeline_->exec(pipe_msg_); |
| 405 | return result_; |
| 406 | } |
| 407 | if (cluster_ != NULL) { |
| 408 | result_ = cluster_->run(*this, nchild, timeout); |
| 409 | return result_; |
| 410 | } |
| 411 | if (conn_ == NULL) { |
| 412 | logger_error("ERROR: cluster_ and conn_ are all NULL"); |
| 413 | return NULL; |
| 414 | } |
| 415 | |
| 416 | conn_->set_check_addr(check_addr_); |
| 417 | |
| 418 | if (slice_req_) { |
| 419 | if (request_obj_ == NULL) { |
| 420 | request_obj_ = NEW redis_request(); |
| 421 | } |
| 422 | result_ = conn_->run(dbuf_, *request_obj_, nchild, timeout); |
| 423 | } else { |
| 424 | if (request_buf_ == NULL) { |
| 425 | request_buf_ = NEW string(128); |
| 426 | } |
| 427 | result_ = conn_->run(dbuf_, *request_buf_, nchild, timeout); |
| 428 | } |
| 429 | return result_; |
| 430 | } |
| 431 | |
| 432 | ///////////////////////////////////////////////////////////////////////////// |
| 433 |
nothing calls this directly
no test coverage detected