Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update expensify_prod branch #1596

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/Cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ bool BedrockCacheCommand::peek(SQLite& db) {
SASSERT(result[0].size() == 2);
response["name"] = result[0][0];
response.content = result[0][1];
SINFO("Pushing " << response["name"] << " to LRU cache");

// Update the LRU Map
plugin()._lruMap.pushMRU(response["name"]);
Expand Down Expand Up @@ -261,6 +262,7 @@ void BedrockCacheCommand::process(SQLite& db) {
auto popResult = plugin()._lruMap.popLRU();
const string& name = (popResult.second ? popResult.first : db.read("SELECT name FROM cache LIMIT 1"));
SASSERT(!name.empty());
SINFO("Deleting " << response["name"] << " from the cache");

// Delete it
if (!db.write("DELETE FROM cache WHERE name=" + SQ(name) + ";")) {
Expand Down