| 606 | } |
| 607 | |
| 608 | void Server::ListSChannelSubscribeNum(const std::vector<std::string> &channels, |
| 609 | std::vector<ChannelSubscribeNum> *channel_subscribe_nums) { |
| 610 | std::lock_guard<std::mutex> guard(pubsub_shard_channels_mu_); |
| 611 | |
| 612 | for (const auto &chan : channels) { |
| 613 | uint16_t slot = config_->cluster_enabled ? GetSlotIdFromKey(chan) : 0; |
| 614 | if (auto iter = pubsub_shard_channels_[slot].find(chan); iter != pubsub_shard_channels_[slot].end()) { |
| 615 | channel_subscribe_nums->emplace_back(ChannelSubscribeNum{iter->first, iter->second.size()}); |
| 616 | } else { |
| 617 | channel_subscribe_nums->emplace_back(ChannelSubscribeNum{chan, 0}); |
| 618 | } |
| 619 | } |
| 620 | } |
| 621 | |
| 622 | void Server::BlockOnKey(const std::string &key, redis::Connection *conn) { |
| 623 | std::lock_guard<std::mutex> guard(blocking_keys_mu_); |
no test coverage detected