提交 0d3da0b8 编写于 作者: W wxyu

MS-611 Add resources validity check in ResourceMgr


Former-commit-id: 0957d8980a07a07434bc2bea3ecff686a56cb127
上级 6d0a2489
......@@ -104,6 +104,10 @@ ResourceMgr::Connect(const std::string& name1, const std::string& name2, Connect
void
ResourceMgr::Clear() {
std::lock_guard<std::mutex> lck(resources_mutex_);
if (running_) {
ENGINE_LOG_ERROR << "ResourceMgr is running, cannot clear.";
return;
}
disk_resources_.clear();
cpu_resources_.clear();
gpu_resources_.clear();
......
......@@ -34,6 +34,7 @@ static constexpr size_t PARALLEL_REDUCE_BATCH = 1000;
std::mutex XSearchTask::merge_mutex_;
// TODO(wxyu): remove unused code
// bool
// NeedParallelReduce(uint64_t nq, uint64_t topk) {
// server::ServerConfig &config = server::ServerConfig::GetInstance();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册