MCPcopy Create free account
hub / github.com/PaddlePaddle/Serving / Clear

Method Clear

core/predictor/framework/request_cache.cpp:217–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217int RequestCache::Clear() {
218 {
219 std::unique_lock<std::mutex> lock(queue_mutex_);
220 std::queue<std::pair<uint64_t, std::shared_ptr<Response>>> empty;
221 swap(empty, task_queue_);
222 }
223 int count = 0;
224 {
225 std::lock_guard<std::recursive_mutex> lk(cache_mtx_);
226 count = lru_.size();
227 lru_.clear();
228 map_.clear();
229 }
230 LOG(INFO) << "Clear " << count << " key!";
231 return 0;
232}
233
234} // namespace predictor
235} // namespace paddle_serving

Callers 2

clear_dataMethod · 0.45
loadMethod · 0.45

Calls 2

sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected