Skip to content

Commit

Permalink
Don't allow empty cache
Browse files Browse the repository at this point in the history
  • Loading branch information
tvorogme committed Sep 9, 2024
1 parent 57a9fdc commit 81ba2e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lite-server-daemon/adnl-lite-proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ namespace ton::liteserver {
promise.set_value(result.clone());
}

cache_similar.erase(it);
cache_similar.erase(data_hash);
}
}

Expand Down Expand Up @@ -980,7 +980,7 @@ namespace ton::liteserver {

auto it = cache_similar.find(data_hash);

if (it != cache_similar.end()) {
if (it != cache_similar.end() && !cache_similar[data_hash].empty()) {
LOG(INFO) << "Found similar request, store: " << data_hash;
it->second.push_back(std::move(promise));
return;
Expand Down

0 comments on commit 81ba2e9

Please sign in to comment.