| 1864 | } |
| 1865 | |
| 1866 | StatusOr<std::unique_ptr<redis::Commander>> Server::LookupAndCreateCommand(const std::string &cmd_name) { |
| 1867 | if (cmd_name.empty()) return {Status::RedisUnknownCmd}; |
| 1868 | |
| 1869 | auto commands = redis::CommandTable::Get(); |
| 1870 | auto cmd_iter = commands->find(util::ToLower(cmd_name)); |
| 1871 | if (cmd_iter == commands->end()) { |
| 1872 | return {Status::RedisUnknownCmd}; |
| 1873 | } |
| 1874 | |
| 1875 | auto cmd_attr = cmd_iter->second; |
| 1876 | auto cmd = cmd_attr->factory(); |
| 1877 | cmd->SetAttributes(cmd_attr); |
| 1878 | |
| 1879 | return std::move(cmd); |
| 1880 | } |
| 1881 | |
| 1882 | Status Server::ScriptExists(const std::string &sha) const { |
| 1883 | std::string body; |
nothing calls this directly
no test coverage detected